]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix memory leak in expression function returning Big_Integer
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 8 Apr 2023 16:29:16 +0000 (18:29 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 29 May 2023 08:23:22 +0000 (10:23 +0200)
commit61c54dd719630570161551bb52b6e5412fc5f85e
treed7d15a0b59ec6f0af085f2f8bd5cd0414223e01f
parente256e67a8a3ce9adceca223a0974fc7dfdac1be5
ada: Fix memory leak in expression function returning Big_Integer

We fail to establish a transient scope around the return statement because
the function returns a controlled type, but this is no longer problematic
because controlled types are no longer returned on the secondary stack.

gcc/ada/

* exp_ch7.adb (Establish_Transient_Scope.Find_Transient_Context):
Bail out for a simple return statement only if the transient scope
and the function both require secondary stack management, or else
if the function is a thunk.
* sem_res.adb (Resolve_Call): Do not create a transient scope when
the call is the expression of a simple return statement.
gcc/ada/exp_ch7.adb
gcc/ada/sem_res.adb