diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2023-08-23 18:35:59 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-09-05 13:05:16 +0200 |
commit | adb3b4d11cb11a35b17bef2590bcdf6bffb06f21 (patch) | |
tree | 08767dddba9cbccdcc1f53fa43eabafc711df409 /gcc | |
parent | d54e996a25d34d1cfaa5fd1de5127668bb43755a (diff) | |
download | gcc-adb3b4d11cb11a35b17bef2590bcdf6bffb06f21.zip gcc-adb3b4d11cb11a35b17bef2590bcdf6bffb06f21.tar.gz gcc-adb3b4d11cb11a35b17bef2590bcdf6bffb06f21.tar.bz2 |
ada: Fix problematic secondary stack management in protected entry
The secondary stack mark goes formally out of scope before the finalizer
reads it to reclaim the storage.
gcc/ada/
* exp_ch9.adb (Build_Protected_Entry): Move the At_End procedure
from the entry body to the inner block statement.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/exp_ch9.adb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index b0e3632..5dcd890 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -3457,6 +3457,7 @@ package body Exp_Ch9 is Set_Uses_Sec_Stack (Block_Id, Uses_Sec_Stack (Corresponding_Spec (N))); Reset_Scopes_To (First (Bod_Stmts), Block_Id); + Set_At_End_Proc (First (Bod_Stmts), At_End_Proc (N)); case Corresponding_Runtime_Package (Pid) is when System_Tasking_Protected_Objects_Entries => @@ -3553,7 +3554,6 @@ package body Exp_Ch9 is -- Establish link between subprogram body and source entry body Set_Corresponding_Entry_Body (Proc_Body, N); - Set_At_End_Proc (Proc_Body, At_End_Proc (N)); Reset_Scopes_To (Proc_Body, Protected_Body_Subprogram (Ent)); return Proc_Body; |