]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix internal error on 'Address of task component
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 31 Oct 2023 16:27:15 +0000 (17:27 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 21 Nov 2023 09:57:42 +0000 (10:57 +0100)
This happens when the prefix of the selected component is of an access type,
i.e. there is an implicit dereference. because the prefix is not resolved.

gcc/ada/

* sem_attr.adb (Resolve_Attribute) <Attribute_Address>: Remove the
bypass for prefixes with task type.

gcc/ada/sem_attr.adb

index 531bc112c9183247a3d6950c579c2d9787673043..000253e7993cc9bbe450f3f789321b612b569178 100644 (file)
@@ -12119,9 +12119,7 @@ package body Sem_Attr is
                Note_Possible_Modification (P, Sure => False);
             end if;
 
-            if Nkind (P) in N_Subexpr
-              and then Is_Overloaded (P)
-            then
+            if Nkind (P) in N_Subexpr and then Is_Overloaded (P) then
                Get_First_Interp (P, Index, It);
                Get_Next_Interp (Index, It);
 
@@ -12135,11 +12133,7 @@ package body Sem_Attr is
             if not Is_Entity_Name (P)
               or else not Is_Overloadable (Entity (P))
             then
-               if not Is_Task_Type (Etype (P))
-                 or else Nkind (P) = N_Explicit_Dereference
-               then
-                  Resolve (P);
-               end if;
+               Resolve (P);
             end if;
 
             --  If this is the name of a derived subprogram, or that of a