]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Crash on function returning empty Ada 2022 aggregate
authorJavier Miranda <miranda@adacore.com>
Tue, 15 Aug 2023 12:57:10 +0000 (12:57 +0000)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 5 Sep 2023 11:05:14 +0000 (13:05 +0200)
commit67138e097ee2af4633fbf904f4251dda5589fc6f
treec528bd59dc7802007a7f98f636139e23acfa6ced
parent9fc6f15bfe7ebfeef6ebbea48b2c551f79cd25bd
ada: Crash on function returning empty Ada 2022 aggregate

The compiler crashes processing a function that returns an empty
aggregate when its returned type is a record type which defined
its container aggregate aspects.

gcc/ada/

* exp_aggr.adb (Expand_Container_Aggregate): Report warning on
infinite recursion if an empty container aggregate appears in the
return statement of its Empty function. Fix typo in comment.
* sem_aggr.adb (Resolve_Aggregate): Resolve Ada 2022 empty
aggregate that initializes a record type that has defined its
container aggregate aspects.
(Resolve_Iterated_Association): Protect access to attribute Etype.
* sem_ch13.adb (Resolve_Aspect_Aggregate): Fix typo in comment.
gcc/ada/exp_aggr.adb
gcc/ada/sem_aggr.adb
gcc/ada/sem_ch13.adb