]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Assert failure in repinfo
authorJavier Miranda <miranda@adacore.com>
Mon, 22 Jul 2024 10:26:41 +0000 (10:26 +0000)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 6 Aug 2024 08:54:30 +0000 (10:54 +0200)
Using switch gnatR4, the frontend crashes when generating information
for a private record type.

gcc/ada/

* repinfo.adb (List_Record_Info): Handle private record types.

gcc/ada/repinfo.adb

index 7dada5358f7a4f96c21a9c2aa1fbd5f0c7528606..c08a232a3ab068111261e6fb5ea59d958c10109e 100644 (file)
@@ -521,7 +521,11 @@ package body Repinfo is
 
                elsif Is_Record_Type (E) then
                   if List_Representation_Info >= 1 then
-                     List_Record_Info (E, Bytes_Big_Endian);
+                     if Is_Private_Type (E) then
+                        List_Record_Info (Full_View (E), Bytes_Big_Endian);
+                     else
+                        List_Record_Info (E, Bytes_Big_Endian);
+                     end if;
 
                      --  Recurse into entities local to a record type