aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2021-06-15 15:36:34 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2021-07-09 12:35:32 +0000
commitf377685e3d82193b0f69bb0742e7f470f63532b2 (patch)
tree11cad8ddf2aec32118ebf967baf51569894f821b /gcc/ada
parentbb66a1021527ab68975a02cc3359c71c69ce443b (diff)
downloadgcc-f377685e3d82193b0f69bb0742e7f470f63532b2.zip
gcc-f377685e3d82193b0f69bb0742e7f470f63532b2.tar.gz
gcc-f377685e3d82193b0f69bb0742e7f470f63532b2.tar.bz2
[Ada] Fix crash on type extensions with discriminants
gcc/ada/ * exp_put_image.adb (Make_Component_Attributes): Use Implementation_Base_Type to get the parent type. Otherwise, Parent_Type_Decl is actually an internally generated subtype declaration, so we blow up on Type_Definition (Parent_Type_Decl).
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/exp_put_image.adb4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/exp_put_image.adb b/gcc/ada/exp_put_image.adb
index 082e08b..87f4b74 100644
--- a/gcc/ada/exp_put_image.adb
+++ b/gcc/ada/exp_put_image.adb
@@ -658,8 +658,8 @@ package body Exp_Put_Image is
if Chars (Defining_Identifier (Item)) = Name_uParent then
declare
Parent_Type : constant Entity_Id :=
- Underlying_Type (Base_Type (
- (Etype (Defining_Identifier (Item)))));
+ Implementation_Base_Type
+ (Etype (Defining_Identifier (Item)));
Parent_Aspect_Spec : constant Node_Id :=
Find_Aspect (Parent_Type, Aspect_Put_Image);