]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/14535 (exception throwing in virtual function doesn't turn on the...
authorRichard Henderson <rth@redhat.com>
Wed, 17 Mar 2004 18:07:30 +0000 (10:07 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 17 Mar 2004 18:07:30 +0000 (10:07 -0800)
        PR middle-end/14535
        * except.c (collect_one_action_chain): Record action for cleanup
        outer of exception spec.

From-SVN: r79592

gcc/ChangeLog
gcc/except.c

index ce2481323d1a8119f8f5491e1dff307c9336c195..af99edc81d5d4d87b16f7c9f20dedcfe8377cad4 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-15  Richard Henderson  <rth@redhat.com>
+
+        PR middle-end/14535
+        * except.c (collect_one_action_chain): Record action for cleanup
+        outer of exception spec.
+
 2004-03-13  Dara Hazeghi  <dhazeghi@yahoo.com>
 
        * doc/install.texi: Note status of -fnew-ra.
index b6f851bcbfb1483f3b636fbfa8d9604b6c3ee4a9..b3093ce50adcf23242f2a12446ad390215ce936c 100644 (file)
@@ -3292,8 +3292,18 @@ collect_one_action_chain (ar_hash, region)
       /* An exception specification adds its filter to the
         beginning of the chain.  */
       next = collect_one_action_chain (ar_hash, region->outer);
-      return add_action_record (ar_hash, region->u.allowed.filter,
-                               next < 0 ? 0 : next);
+
+      /* If there is no next action, terminate the chain.  */
+      if (next == -1)
+       next = 0;
+      /* If all outer actions are cleanups or must_not_throw,
+        we'll have no action record for it, since we had wanted
+        to encode these states in the call-site record directly.
+        Add a cleanup action to the chain to catch these.  */
+      else if (next <= 0)
+       next = add_action_record (ar_hash, 0, 0);
+      
+      return add_action_record (ar_hash, region->u.allowed.filter, next);
 
     case ERT_MUST_NOT_THROW:
       /* A must-not-throw region with no inner handlers or cleanups