]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Compiler crash on container aggregate association with nonstatic key choice
authorGary Dismukes <dismukes@adacore.com>
Thu, 21 Aug 2025 18:48:12 +0000 (18:48 +0000)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 11 Sep 2025 09:10:48 +0000 (11:10 +0200)
commit767fce326ec142a3d63b5472814ff516e363d8dc
tree1a09465c01b4683477ad8615d7b711e0fae7be05
parent629f1de233948a06f1c9e0064b2c2804892a02e6
ada: Compiler crash on container aggregate association with nonstatic key choice

The compiler blows up on a container aggregate with a container element
association that has a key_choice given by a nonstatic key expression.
This happens in the size computation for the aggregate due to calling
Update_Choices with the nonstatic expression.  The fix is simply to
condition the call to Update_Choices on whether the choice expression
is static.

gcc/ada/ChangeLog:

* exp_aggr.adb (Build_Container_Aggr_Code.Build_Size_Expr): In the case
of an association with a single choice, only call Update_Choices when
the choice expression is nonstatic.
gcc/ada/exp_aggr.adb