]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix assertion failure for improper aggregate operation
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 6 Mar 2026 11:27:20 +0000 (12:27 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 28 May 2026 08:52:52 +0000 (10:52 +0200)
The compiler takes the Entity of a node without checking that it may.

gcc/ada/ChangeLog:

* sem_ch13.adb (Resolve_Aspect_Aggregate.Resolve_Operation): Add
missing guard for the presence of Entity on the node.

gcc/ada/sem_ch13.adb

index 0be8f323691d4381a687f36dbfa67f33b0713c9d..a08b13445db5a127e249f272300ce6c19085f724 100644 (file)
@@ -18235,7 +18235,9 @@ package body Sem_Ch13 is
 
       begin
          if not Is_Overloaded (Subp_Id) then
-            if not Pred (Entity (Subp_Id)) then
+            if not Is_Entity_Name (Subp_Id)
+              or else not Pred (Entity (Subp_Id))
+            then
                Error_Msg_NE
                  ("improper aggregate operation for&", Subp_Id, Typ);
             end if;