aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-10-25 21:15:58 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2021-11-09 09:44:47 +0000
commit51ad879c72e77f8a4021256c4aaf5567c6f587cf (patch)
tree56ecfcfb14a3ddf36a3ccc2a46f93eda1c08bfbb /gcc
parentca803c3d7ba5c6626d37e615aec1748ac4199c9b (diff)
downloadgcc-51ad879c72e77f8a4021256c4aaf5567c6f587cf.zip
gcc-51ad879c72e77f8a4021256c4aaf5567c6f587cf.tar.gz
gcc-51ad879c72e77f8a4021256c4aaf5567c6f587cf.tar.bz2
[Ada] Fix detection of array aggregates with single others associations
gcc/ada/ * checks.adb (Apply_Constraint_Check): Guard against calling Choices when the first association in an array aggregate is a N_Iterated_Component_Association node.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/checks.adb2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index bbccab7..6fb33b4 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -1388,6 +1388,8 @@ package body Checks is
if Nkind (N) = N_Aggregate
and then No (Expressions (N))
+ and then Nkind (First (Component_Associations (N))) =
+ N_Component_Association
and then Nkind
(First (Choices (First (Component_Associations (N)))))
= N_Others_Choice