]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Compiler hangs on container aggregate with function call as key expression
authorGary Dismukes <dismukes@adacore.com>
Thu, 30 Nov 2023 19:28:42 +0000 (19:28 +0000)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 19 Dec 2023 14:27:50 +0000 (15:27 +0100)
commitb09d948e0520574d40587c086fa43ade7316d466
tree89fe7574e242217c50ad88a0a6477c4e7bf14af5
parentb90089402f79ef4be049001c381dd6446af437a5
ada: Compiler hangs on container aggregate with function call as key expression

The compiler hangs (or may crash, if assertions are enabled) when compiling
an iterated association of a container aggregate that has a key expression
given by a function call. The resolution of the call leads to a blowup in
Build_Call_Marker, because the temporary copy of the expression that's
analyzed has an Empty parent, causing insertion of the call marker to fail.
The fix for this is to preanalyze, rather than analyze, the copy of the key
expression (Build_Call_Marker will return without creating a call marker in
the case of preanalysis).

gcc/ada/

* sem_aggr.adb (Resolve_Iterated_Association): Call
Preanalyze_And_Resolve instead of Analyze_And_Resolve on a key
expression of an iterated association.
gcc/ada/sem_aggr.adb