[Bug ada/15800] segfault on mutually recursive record type declarations
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Oct 27 08:57:22 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15800
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eric Botcazou <ebotcazou@gcc.gnu.org>:
https://gcc.gnu.org/g:476cfea758fa1240b5ae8bc25ac8eb0de06fff89
commit r16-4640-g476cfea758fa1240b5ae8bc25ac8eb0de06fff89
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Mon Oct 27 09:53:57 2025 +0100
Ada: Fix segfault on mutually recursive record type declarations
This was reported a long time ago and is again a fairly pathological case,
but it turns out to be unfixable with the current model of type freezing
in GNAT (which is the second one suggested in the AARM 13.14(19.i) clause).
The code is legal but, as the declaration of any object of the types will
exhaust the heap and eventually raise Storage_Error, it is totally useless.
The patch contains a small cleanup in a related area as well as the
addition
of a commented assertion in gigi, so that the compiler shuts down properly.
gcc/ada/
PR ada/15800
* freeze.adb (Freeze_Entity.Freeze_Record_Type): Small cleanup
in code and comments.
* gcc-interface/utils.cc (create_field_decl): Assert that the type
of the field is frozen at this point.
More information about the Gcc-bugs
mailing list