[Ada] Compiler crash on assertion pragma in ghost region
authorJustin Squirek <squirek@adacore.com>
Tue, 6 Oct 2020 19:01:15 +0000 (15:01 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 24 Nov 2020 10:16:06 +0000 (05:16 -0500)
gcc/ada/

* sem_prag.adb (Analyze_Pragma): Mark relevant pragmas as ghost
when they are within a ghost region.

gcc/ada/sem_prag.adb

index 8e36976..a46f52f 100644 (file)
@@ -11437,6 +11437,12 @@ package body Sem_Prag is
          end if;
       end if;
 
+      --  Mark assertion pragmas as Ghost depending on their enclosing context
+
+      if Assertion_Expression_Pragma (Prag_Id) then
+         Mark_Ghost_Pragma (N, Current_Scope);
+      end if;
+
       --  Preset arguments
 
       Arg_Count := 0;