From: Ghjuvan Lacambre Date: Fri, 9 Oct 2020 14:36:45 +0000 (+0200) Subject: [Ada] Fix crash on invalid `pragma Profile` X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=193040a071b1170e5e22b7371d81b880f69aeae1;p=gcc.git [Ada] Fix crash on invalid `pragma Profile` gcc/ada/ * sem_prag.adb (Analyze_Pragma): Emit error on wrong argument nkind. --- diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 5a2dffff0f4..eda8898bdb3 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -21494,7 +21494,11 @@ package body Sem_Prag is Argx : constant Node_Id := Get_Pragma_Arg (Arg1); begin - if Chars (Argx) = Name_Ravenscar then + if Nkind (Argx) /= N_Identifier then + Error_Msg_N + ("argument of pragma Profile must be an identifier", N); + + elsif Chars (Argx) = Name_Ravenscar then Set_Ravenscar_Profile (Ravenscar, N); elsif Chars (Argx) = Name_Jorvik then