]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix crash on iterator of type with Constant_Indexing aspect
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 29 Aug 2025 07:24:33 +0000 (09:24 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 15 Sep 2025 12:59:29 +0000 (14:59 +0200)
commitfa714c16d45e56f27733f4be3eeb3070457a4667
treeb9725cff3dec2bedadf806735d87f88eee6df5b1
parentc7ef48f2be5aa75ba9108ef1f6ac3a3206a14c9f
ada: Fix crash on iterator of type with Constant_Indexing aspect

This happens when the type returned by the indexing function is a private
type whose completion is derived from another private type, because the
Finalize_Address routine cannot correctly fetch the actual root type.

gcc/ada/ChangeLog:

* exp_util.adb (Finalize_Address): In an untagged derivation, call
Root_Type on the full view of the base type if the partial view is
itself not a derived type.
(Is_Untagged_Derivation): Minor formatting tweak.
gcc/ada/exp_util.adb