From 1180b8fb8c74da9991a1e1066961d1b3f2bd6e4b Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Mon, 3 Oct 2022 16:49:19 +0200 Subject: [PATCH] ada: Reject conditional goto in lock-free protected subprograms In lock-free protected subprograms we don't allow goto statements; likewise, we now reject conditional goto statements. This fix only affects semantic checking mode with switch -gnatc. In ordinary compilation we already rejected conditional goto after it was expanded into ordinary goto. gcc/ada/ * sem_ch9.adb (Allows_Lock_Free_Implementation): Reject conditional goto statements. --- gcc/ada/sem_ch9.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index 6506358a02b7..f2a590178653 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -453,7 +453,7 @@ package body Sem_Ch9 is -- Goto statements restricted - elsif Kind = N_Goto_Statement then + elsif Kind in N_Goto_Statement | N_Goto_When_Statement then if Lock_Free_Given then Error_Msg_N ("goto statement not allowed", N); return Skip; -- 2.47.2