]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Fix detection of array aggregates with single others associations
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 25 Oct 2021 19:15:58 +0000 (21:15 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 9 Nov 2021 09:44:47 +0000 (09:44 +0000)
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.

gcc/ada/checks.adb

index bbccab765c0597ccbd1cf87a46c693b8d98ff9f7..6fb33b45ae942c502ae3bc07bf311d54e93a717b 100644 (file)
@@ -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