aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/inline.adb
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-11-02 15:05:06 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-11-21 10:57:43 +0100
commit5a6dbb34c521e79ced35ce778bc86b39f3d348a7 (patch)
treef5a1f800c82084971137f9c54e59ddf4e735ef20 /gcc/ada/inline.adb
parent87517ca34eb1d65f33fd01e4e5e6fa900cb65f4b (diff)
downloadgcc-5a6dbb34c521e79ced35ce778bc86b39f3d348a7.zip
gcc-5a6dbb34c521e79ced35ce778bc86b39f3d348a7.tar.gz
gcc-5a6dbb34c521e79ced35ce778bc86b39f3d348a7.tar.bz2
ada: Another couple of cleanups in the finalization machinery
For package specs and bodies that need finalizers, Build_Finalizer is invoked from the Standard scope so it needs to adjust the scope stack before creating new objects; this changes it to do so only once. For other kinds of scopes, it is invoked from Expand_Cleanup_Actions, which assumes that the correct scope is already on the stack; that's why Cleanup_Scopes adjusts the scope stack explicitly, but it should use Pop_Scope instead of End_Scope to do it. gcc/ada/ * exp_ch7.adb (Build_Finalizer): For package specs and bodies, push and pop the specs onto the scope stack only once. * inline.adb (Cleanup_Scopes): Call Pop_Scope instead of End_Scope.
Diffstat (limited to 'gcc/ada/inline.adb')
-rw-r--r--gcc/ada/inline.adb2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index 5fff881..1fbbe6d 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -2908,7 +2908,7 @@ package body Inline is
else
Push_Scope (Scop);
Expand_Cleanup_Actions (Decl);
- End_Scope;
+ Pop_Scope;
end if;
Next_Elmt (Elmt);