]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Compiler crash on array aggregate association iterating over function result
authorGary Dismukes <dismukes@adacore.com>
Fri, 10 Jan 2025 22:39:52 +0000 (22:39 +0000)
committerEric Botcazou <ebotcazou@adacore.com>
Thu, 5 Jun 2025 13:29:32 +0000 (15:29 +0200)
commita52223c5b2ba677468b5fabc010492998e4dea3a
treee3f2ef269e248fb21a0856aa4da1549d0fc25d54
parentd9fb0b4d8a401cc64d59eb49e3617f7c32cefb19
ada: Compiler crash on array aggregate association iterating over function result

The compiler triggers a bug box when compiling an array aggregate with
an iterated_component_association that iterates over another array object,
failing when trying to retrieve a Choices field, which isn't an allowed
field for N_Iterated_Component_Association nodes. This occurs in procedure
Check_Function_Writable_Actuals, which wasn't accounting for the iterated
association forms.

gcc/ada/ChangeLog:

* sem_util.adb (Check_Function_Writable_Actuals): Add handling for
N_Iterated_Component_Association and N_Iterated_Element_Association.
Fix a typo in an RM reference (6.4.1(20/3) => 6.4.1(6.20/3)).
(Collect_Expression_Ids): New procedure factoring code for collecting
identifiers from expressions of aggregate associations.
(Handle_Association_Choices): New procedure factoring code for handling
id collection for expressions of aggregate associations with multiple
choices. Removed redundant test of Box_Present from original code.
gcc/ada/sem_util.adb