]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Compiler crash on container aggregate with loop_parameter_specifications
authorGary Dismukes <dismukes@adacore.com>
Thu, 2 Nov 2023 23:36:12 +0000 (23:36 +0000)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 21 Nov 2023 09:57:43 +0000 (10:57 +0100)
commit1f61f81d6ce2fe9c0ee0d833d216b848e0ad0ae4
treecafc25e4fe12532a5e2b151c0403b1ff00131d13
parent5a6dbb34c521e79ced35ce778bc86b39f3d348a7
ada: Compiler crash on container aggregate with loop_parameter_specifications

The compiler crashes on a container aggregate with more than one
iterated_element_association given by a loop_parameter_specification.
In such a case, the tree contains N_Iterated_Component_Association
nodes rather than N_Iterated_Element_Association nodes, and the code
for handling those needs to obtain the bounds from the Discrete_Choices
field of each N_Iterated_Component_Association rather than assuming
that the association has a normal list of choices.

gcc/ada/

* sem_aggr.adb (Resolve_Container_Aggregate): In the case where Comp
is an N_Iterated_Component_Association, pick up Discrete_Choices rather
than Choices.
gcc/ada/sem_aggr.adb