[Bug ada/112461] [14 regression] premature finalization with nested return inside extended one

ebotcazou at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Dec 4 10:05:00 GMT 2023


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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
https://gcc.gnu.org/g:f6bbf84ec759f203251c6c5a0dec8344f17cc614

commit r14-5909-gf6bbf84ec759f203251c6c5a0dec8344f17cc614
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Wed Nov 8 23:29:01 2023 +0100

    ada: Fix premature finalization for nested return within extended one

    The return object is incorrectly finalized when the nested return is taken,
    because the special flag attached to the return object is not updated.

    gcc/ada/
            * exp_ch6.adb (Build_Flag_For_Function): New function made up of
the
            code building the special flag for return object present...
            (Expand_N_Extended_Return_Statement): ...in there.  Replace the
code
            with a call to Build_Flag_For_Function.  Add assertion for the
flag.
            (Expand_Non_Function_Return): For a nested return, if the return
            object needs finalization actions, update the special flag.


More information about the Gcc-bugs mailing list