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

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

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

commit r17-6294-gb09254d9488cf795f9765db99e1362756a1bd21e
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