]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Assert failure on pragma Inline in procedure body
authorArnaud Charlet <charlet@adacore.com>
Wed, 20 Jan 2021 09:50:14 +0000 (04:50 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 6 May 2021 07:51:33 +0000 (03:51 -0400)
gcc/ada/

* sem_ch6.adb (Is_Inline_Pragma): Protect against N not being a
list member in both branches.

gcc/ada/sem_ch6.adb

index a53540d5c3d1355912683d5a70070b0236171d20..a919a0af22da294342f217ec072a99599febd8d1 100644 (file)
@@ -3416,15 +3416,13 @@ package body Sem_Ch6 is
             Prag := Empty;
          end if;
 
-         if Present (Prag) then
+         if Present (Prag) and then Is_List_Member (N) then
             if Present (Spec_Id) then
-               if Is_List_Member (N)
-                 and then Is_List_Member (Unit_Declaration_Node (Spec_Id))
+               if Is_List_Member (Unit_Declaration_Node (Spec_Id))
                  and then In_Same_List (N, Unit_Declaration_Node (Spec_Id))
                then
                   Analyze (Prag);
                end if;
-
             else
                --  Create a subprogram declaration, to make treatment uniform.
                --  Make the sloc of the subprogram name that of the entity in