aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMarc Poulhiès <poulhies@adacore.com>2022-03-28 16:03:48 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-18 08:40:59 +0000
commit5488c78c836ca71330bc69247bf75aa14d9d2603 (patch)
treeec6f424a8977ca67fe70e99168bcd7034c2026e3 /gcc
parentbf7143f736d66051083a6f5d569dc85cfad7e7f6 (diff)
downloadgcc-5488c78c836ca71330bc69247bf75aa14d9d2603.zip
gcc-5488c78c836ca71330bc69247bf75aa14d9d2603.tar.gz
gcc-5488c78c836ca71330bc69247bf75aa14d9d2603.tar.bz2
[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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_ch12.adb4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index bc08335..c5f2eed 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