]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix for compiler crash on function return with Relaxed_Finalization parts
authorGary Dismukes <dismukes@adacore.com>
Tue, 20 May 2025 00:16:25 +0000 (00:16 +0000)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 1 Jul 2025 08:29:44 +0000 (10:29 +0200)
commit64efbc69e93e7c052300131f64b3ea5134a88d71
treee27d7783e8eab52adab3780926acfa867f561fc0
parentf1c22e6ea6e384ad07cb94dc20595de3e2b59e1d
ada: Fix for compiler crash on function return with Relaxed_Finalization parts

The compiler crashes on compiling a return statement of a function whose result
type has a component whose type is specified with Relaxed_Finalization. The
compiler was attempting to retrieve a nonexistent BIP_Collection extra formal
from the enclosing function, which may not exist in the case of result types
with Relaxed_Finalization.

gcc/ada/ChangeLog:

* exp_ch3.adb (Build_Heap_Or_Pool_Allocator): Test not Has_Relaxed_Finalization
as a guard against retrieving BIP_Collection formal (and related code).
gcc/ada/exp_ch3.adb