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 r13-587] [Ada] Fix incorrect freezing with generic child unit
Date: Wed, 18 May 2022 08:43:06 +0000 (GMT)	[thread overview]
Message-ID: <20220518084306.C3DD63857805@sourceware.org> (raw)

https://gcc.gnu.org/g:5488c78c836ca71330bc69247bf75aa14d9d2603

commit r13-587-g5488c78c836ca71330bc69247bf75aa14d9d2603
Author: Marc Poulhiès <poulhies@adacore.com>
Date:   Mon Mar 28 16:03:48 2022 +0200

    [Ada] Fix incorrect freezing with generic child unit
    
    The Analyze_Associations.Check_Generic_Parent function was using an
    incorrect node as the instanciation node for the actual, possibly
    leading to incorrect freeze node being created (and later crashing in
    gigi). Using Get_Unit_Instantiation_Node fixes the issue.
    
    gcc/ada/
    
            * sem_ch12.adb (Check_Generic_Parent): Use
            Get_Unit_Instantiation_Node instead of Next.

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

diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index bc083359813..c5f2eed96fd 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -1164,7 +1164,7 @@ package body Sem_Ch12 is
       function Matching_Actual
         (F   : Entity_Id;
          A_F : Entity_Id) return Node_Id;
-      --  Find actual that corresponds to a given a formal parameter. If the
+      --  Find actual that corresponds to a given formal parameter. If the
       --  actuals are positional, return the next one, if any. If the actuals
       --  are named, scan the parameter associations to find the right one.
       --  A_F is the corresponding entity in the analyzed generic, which is
@@ -2063,7 +2063,7 @@ package body Sem_Ch12 is
 
                         procedure Check_Generic_Parent is
                            Inst : constant Node_Id :=
-                                    Next (Unit_Declaration_Node (Actual));
+                                    Get_Unit_Instantiation_Node (Actual);
                            Par  : Entity_Id;
 
                         begin


                 reply	other threads:[~2022-05-18  8:43 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=20220518084306.C3DD63857805@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).