From: Piotr Trojanek Date: Tue, 1 Dec 2020 14:17:27 +0000 (+0100) Subject: [Ada] Prevent early exits without restoring a global variable X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=96c1f71463d067012241179df71c5872cec7a765;p=gcc.git [Ada] Prevent early exits without restoring a global variable gcc/ada/ * sem_ch5.adb (Analyze_Case_Statement): Move modification of Unblocked_Exit_Count after early return statements; fix typo in comment. --- diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 380d6017414..04fc9806c58 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -1494,7 +1494,6 @@ package body Sem_Ch5 is -- Start of processing for Analyze_Case_Statement begin - Unblocked_Exit_Count := 0; Analyze (Exp); -- The expression must be of any discrete type. In rare cases, the @@ -1558,7 +1557,9 @@ package body Sem_Ch5 is Exp_Type := Exp_Btype; end if; - -- Call instantiated procedures to analyzwe and check discrete choices + -- Call instantiated procedures to analyze and check discrete choices + + Unblocked_Exit_Count := 0; Analyze_Choices (Alternatives (N), Exp_Type); Check_Choices (N, Alternatives (N), Exp_Type, Others_Present);