]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Unbounded recursion on character aggregates with predicated component subtype
authorGary Dismukes <dismukes@adacore.com>
Wed, 8 Jan 2025 22:51:41 +0000 (22:51 +0000)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 13 Jan 2025 10:52:58 +0000 (11:52 +0100)
commitc6989fbbf2f195e874245409635a856d74bf6945
tree534628888d0077081162344700a10e53f7642ba0
parentf9d22b7ac734a917f3ee379336ad764ccd6f74ca
ada: Unbounded recursion on character aggregates with predicated component subtype

The compiler was recursing endlessly when analyzing an aggregate of
an array type whose component subtype has a static predicate and the
component expressions are static, repeatedly transforming the aggregate
first into a string literal and then back into an aggregate. This is fixed
by suppressing the transformation to a string literal in the case where
the component subtype has predicates.

gcc/ada/ChangeLog:

* sem_aggr.adb (Resolve_Aggregate): Add another condition to prevent rewriting
an aggregate whose type is an array of characters, testing for the presence of
predicates on the component type.
gcc/ada/sem_aggr.adb