https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128693

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Eric Botcazou
<[email protected]>:

https://gcc.gnu.org/g:0be9c1d0075006ce99a3c739d6a3110ac8a28d77

commit r16-9965-g0be9c1d0075006ce99a3c739d6a3110ac8a28d77
Author: Eric Botcazou <[email protected]>
Date:   Sun Nov 15 17:52:55 2026 +0100

    Ada: Fix memory leak for conditionally evaluated 'Old of finalizable type

    This fixes an oversight in the implementation of the special trick used for
    a conditionally evaluated 'Old of a type that needs finalization present in
    a post-condition: it is supposed to allocate the temporary holding the old
    value on the secondary stack, but it ends up allocating on the plain heap.

    gcc/ada/
            PR ada/128693
            * exp_util.adb (Build_Allocate_Deallocate_Proc): Generate a call to
            SS_Allocate_Any_Controlled for the secondary stack pool.
            * rtsfind.ads (RE_Id): Add RE_SS_Allocate_Any_Controlled.
            (RE_Unit_Table): Add entry for RE_SS_Allocate_Any_Controlled.
            * libgnat/s-stposu.ads (SS_Allocate_Any_Controlled): Declare.
            * libgnat/s-stposu.adb: Add clauses for System.Secondary_Stack.
            (SS_Allocate_Any_Controlled): New procedure.

Reply via email to