aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-08-03 22:54:18 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-21 03:22:46 -0400
commit3b612313b6e67dd01159cd8ceeafeac9f9e6dd04 (patch)
tree913f0815a50eec49a6d72d2f6892698a3973c4fe
parent7c6fb753e2103347f2a4d6e31c845ed13c2b859e (diff)
downloadgcc-3b612313b6e67dd01159cd8ceeafeac9f9e6dd04.zip
gcc-3b612313b6e67dd01159cd8ceeafeac9f9e6dd04.tar.gz
gcc-3b612313b6e67dd01159cd8ceeafeac9f9e6dd04.tar.bz2
[Ada] Fix crash with iterated_component_association and -gnatc
gcc/ada/ * sem_aggr.adb (Resolve_Iterated_Component_Association): Expression's copy and now has the same parent as the original expression. (Resolve_Array_Aggregate): Add ??? comment about a still existing minor issue that led to discovery of the above crash.
-rw-r--r--gcc/ada/sem_aggr.adb8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index c7d1e49..7587295 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -1662,6 +1662,7 @@ package body Sem_Aggr is
-- as a loop with a new index variable.
Expr := New_Copy_Tree (Expression (N));
+ Set_Parent (Expr, N);
Dummy := Resolve_Aggr_Expr (Expr, False);
-- An iterated_component_association may appear in a nested
@@ -2057,8 +2058,13 @@ package body Sem_Aggr is
return Failure;
end if;
+ -- ??? Checks for dynamically tagged expressions below will
+ -- be only applied to iterated_component_association after
+ -- expansion; in particular, errors might not be reported when
+ -- -gnatc switch is used.
+
elsif Nkind (Assoc) = N_Iterated_Component_Association then
- null; -- handled above, in a loop context.
+ null; -- handled above, in a loop context
elsif not Resolve_Aggr_Expr
(Expression (Assoc), Single_Elmt => Single_Choice)