public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-2217] [Ada] Fix crash on type extensions with discriminants
Date: Fri,  9 Jul 2021 12:40:00 +0000 (GMT)	[thread overview]
Message-ID: <20210709124000.0CFE0398B0FF@sourceware.org> (raw)

https://gcc.gnu.org/g:f377685e3d82193b0f69bb0742e7f470f63532b2

commit r12-2217-gf377685e3d82193b0f69bb0742e7f470f63532b2
Author: Bob Duff <duff@adacore.com>
Date:   Tue Jun 15 15:36:34 2021 -0400

    [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).

Diff:
---
 gcc/ada/exp_put_image.adb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/exp_put_image.adb b/gcc/ada/exp_put_image.adb
index 082e08b6dde..87f4b74e35a 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);


                 reply	other threads:[~2021-07-09 12:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210709124000.0CFE0398B0FF@sourceware.org \
    --to=pmderodat@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).