aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2024-01-05 12:04:17 +0100
committerMarc Poulhiès <poulhies@adacore.com>2024-05-07 09:55:51 +0200
commit6fa5f50897c4beba0b55f0c0b76529758a5d24bd (patch)
treeccf71027f5f55f9acb0ec2e63c963be3d87c0add
parent428f83d7b10d92e223dac171cdfba4e9d084823f (diff)
downloadgcc-6fa5f50897c4beba0b55f0c0b76529758a5d24bd.zip
gcc-6fa5f50897c4beba0b55f0c0b76529758a5d24bd.tar.gz
gcc-6fa5f50897c4beba0b55f0c0b76529758a5d24bd.tar.bz2
ada: Fix Program_Error raised during generation of data representation in JSON
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.
-rw-r--r--gcc/ada/repinfo.adb6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb
index 28a587f..28e4a64 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;