]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix libgpr2 build failure with compiler built with assertions
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 24 Feb 2025 21:27:21 +0000 (22:27 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 6 Jun 2025 08:37:08 +0000 (10:37 +0200)
The problem is that the Entity field is accessed for a node without one.

gcc/ada/ChangeLog:

* sem_ch10.adb (Install_Siblings.In_Context): Add missing guard.

gcc/ada/sem_ch10.adb

index 9af96fc41b6ba6489351680fef2d3ea8e3ecb0b0..25bba9b607597fa387bd1de00d34f8ed7a46e458 100644 (file)
@@ -4924,6 +4924,8 @@ package body Sem_Ch10 is
                            if Entity (Name (Clause)) = Id
                              or else
                                (Nkind (Name (Clause)) = N_Expanded_Name
+                                 and then
+                                   Is_Entity_Name (Prefix (Name (Clause)))
                                  and then Entity (Prefix (Name (Clause))) = Id)
                            then
                               return True;