2008-05-26 Ed Schonberg <schonberg@adacore.com>
authorEd Schonberg <schonberg@adacore.com>
Mon, 26 May 2008 09:40:31 +0000 (11:40 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 26 May 2008 09:40:31 +0000 (11:40 +0200)
* inline.adb:
(Cleanup_Scopes): For a protected operation, transfer finalization list
to protected body subprogram, to force cleanup actions when needed.

From-SVN: r135900

gcc/ada/inline.adb

index 332994ea285e0d63086b06ae0c5692991c84bc6b..296ff6b1df579ccb1ea5b526ce7590f46a5927e5 100644 (file)
@@ -847,11 +847,15 @@ package body Inline is
             --  cleanup operations have been delayed, and the subprogram
             --  has been rewritten in the expansion of the enclosing
             --  protected body. It is the corresponding subprogram that
-            --  may require the cleanup operations.
+            --  may require the cleanup operations, so propagate the
+            --  information that triggers cleanup activity.
 
             Set_Uses_Sec_Stack
               (Protected_Body_Subprogram (Scop),
                 Uses_Sec_Stack (Scop));
+            Set_Finalization_Chain_Entity
+              (Protected_Body_Subprogram (Scop),
+                Finalization_Chain_Entity (Scop));
             Scop := Protected_Body_Subprogram (Scop);
          end if;