From 78004c41f7830fcef5bdefeec8edad6737c2af1a Mon Sep 17 00:00:00 2001 From: Justin Squirek Date: Tue, 6 Oct 2020 15:01:15 -0400 Subject: [PATCH] [Ada] Compiler crash on assertion pragma in ghost region gcc/ada/ * sem_prag.adb (Analyze_Pragma): Mark relevant pragmas as ghost when they are within a ghost region. --- gcc/ada/sem_prag.adb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 8e36976bc9f..a46f52f0838 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -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; -- 2.30.2