* [COMMITTED] ada: Fix Program_Error raised during generation of data representation in JSON
@ 2024-05-07 7:59 Marc Poulhiès
0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2024-05-07 7:59 UTC (permalink / raw)
To: gcc-patches; +Cc: Eric Botcazou
From: Eric Botcazou <ebotcazou@adacore.com>
This happens for the extension of a private discriminated tagged type.
gcc/ada/
* repinfo.adb (List_Record_Info.List_Structural_Record_Layout): Add
another guard for private types after retrieving the parent in the
extension case.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/repinfo.adb | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb
index 28a587f039b..28e4a642765 100644
--- a/gcc/ada/repinfo.adb
+++ b/gcc/ada/repinfo.adb
@@ -1491,6 +1491,12 @@ package body Repinfo is
else
Parent_Type := Base_Type (Parent_Type);
+
+ if Is_Private_Type (Parent_Type) then
+ Parent_Type := Full_View (Parent_Type);
+ pragma Assert (Present (Parent_Type));
+ end if;
+
if not In_Extended_Main_Source_Unit (Parent_Type) then
raise Not_In_Extended_Main;
end if;
--
2.43.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-05-07 7:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-07 7:59 [COMMITTED] ada: Fix Program_Error raised during generation of data representation in JSON Marc Poulhiès
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).