[Ada] Crash on renaming within declare expression
authorJustin Squirek <squirek@adacore.com>
Thu, 12 Aug 2021 12:54:15 +0000 (08:54 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 1 Oct 2021 06:13:38 +0000 (06:13 +0000)
gcc/ada/

* exp_dbug.adb (Debug_Renaming_Declaration): Add check for
Entity present for Ren to prevent looking at unanalyzed nodes

gcc/ada/exp_dbug.adb

index a375169..96d78cc 100644 (file)
@@ -409,7 +409,9 @@ package body Exp_Dbug is
             when N_Expanded_Name
                | N_Identifier
             =>
-               if not Present (Renamed_Object (Entity (Ren))) then
+               if No (Entity (Ren))
+                 or else not Present (Renamed_Object (Entity (Ren)))
+               then
                   exit;
                end if;