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

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

https://gcc.gnu.org/g:b439ee5dbc549c1ab4634eb6df8e2c5fa7b21c53

commit r15-11736-gb439ee5dbc549c1ab4634eb6df8e2c5fa7b21c53
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