diff options
author | Gary Dismukes <dismukes@adacore.com> | 2024-01-04 00:34:33 +0000 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-05-06 11:11:32 +0200 |
commit | 911d921759e4a32bac81016b2dda1e26147ba5d8 (patch) | |
tree | 672f9b9101197ec0c484d72650ac1b9925b33e93 /libgcc | |
parent | 9737a48553b7b489bbecb59b6dd9a96ed02bb1f8 (diff) | |
download | gcc-911d921759e4a32bac81016b2dda1e26147ba5d8.zip gcc-911d921759e4a32bac81016b2dda1e26147ba5d8.tar.gz gcc-911d921759e4a32bac81016b2dda1e26147ba5d8.tar.bz2 |
ada: Excess finalization on return of call to dispatching constructor
The compiler expands a too-early finalization call for the result
object of an extended return statement that returns a call to a
dispatching constructor function for a limited interface type,
resulting in premature (and extra) finalization of the result.
The temporary object that the compiler creates to hold the result
of the build-in-place call loses the fact that it comes from a
return, and the wrong BIP allocation form may be passed in the
call to the dispatching constructor, and the later code for dealing
with finalization in Exp_Ch7.Build_Finalizer incorrectly finalizes
the result object.
gcc/ada/
* exp_ch6.adb
(Make_Build_In_Place_Iface_Call_In_Object_Declaration): Set the
Is_Return_Object flag on the entity of the temp object created to
hold the BIP call result, from the flag on the passed-in object
declaration's entity. Update copyright notice to 2024.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions