]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
except.h: Add outer_context_label_stack.
authorJason Merrill <jason@yorick.cygnus.com>
Fri, 21 Nov 1997 20:21:39 +0000 (20:21 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 21 Nov 1997 20:21:39 +0000 (15:21 -0500)
* except.h: Add outer_context_label_stack.
* except.c: Likewise.
(expand_start_all_catch): Push the outer_context for the try block
  onto outer_context_label_stack.
(expand_end_all_catch): Use it and pop it.

From-SVN: r16646

gcc/ChangeLog
gcc/except.c
gcc/except.h

index 56797ef653eadd02f94e309cfe7d7301b0eb12e2..b94e102ec9f0bf87894d5b240d6dc36ed4be2aa2 100644 (file)
@@ -1,3 +1,11 @@
+Fri Nov 21 12:18:51 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * except.h: Add outer_context_label_stack.
+       * except.c: Likewise.
+       (expand_start_all_catch): Push the outer_context for the try block
+       onto outer_context_label_stack.
+       (expand_end_all_catch): Use it and pop it.
+
 Fri Nov 21 10:13:11 1997  Robert Lipe (robertl@dgii.com)
 
        * i386/sco5.h (HAVE_ATEXIT): Revert last change.
index 3892f964d0880372ed49186db088953ae13f4838..102a0bbcccf026678dd2a08fb235d47c9c369dbe 100644 (file)
@@ -483,12 +483,15 @@ static tree protect_list;
 
 /* Keeps track of the label to resume to should one want to resume
    normal control flow out of a handler (instead of, say, returning to
-   the caller of the current function or exiting the program).  Also
-   used as the context of a throw to rethrow an exception to the outer
-   exception region.  */
+   the caller of the current function or exiting the program).  */
 
 struct label_node *caught_return_label_stack = NULL;
 
+/* Keeps track of the label used as the context of a throw to rethrow an
+   exception to the outer exception region.  */
+
+struct label_node *outer_context_label_stack = NULL;
+
 /* A random data area for the front end's own use.  */
 
 struct label_node *false_label_stack = NULL;
@@ -1254,6 +1257,9 @@ expand_start_all_catch ()
   if (! doing_eh (1))
     return;
 
+  push_label_entry (&outer_context_label_stack,
+                   ehstack.top->entry->outer_context, NULL_TREE);
+
   /* End the try block.  */
   expand_eh_region_end (integer_zero_node);
 
@@ -1372,7 +1378,7 @@ expand_end_all_catch ()
         thrown from) so that the outer EH region can then try to process
         the exception.  */
 
-      expand_internal_throw (DECL_RTL (top_label_entry (&caught_return_label_stack)));
+      expand_internal_throw (outer_context_label_stack->u.rlabel);
     }
 
   /* Now we have the complete catch sequence.  */
@@ -1382,6 +1388,7 @@ expand_end_all_catch ()
   /* This level of catch blocks is done, so set up the successful
      catch jump label for the next layer of catch blocks.  */
   pop_label_entry (&caught_return_label_stack);
+  pop_label_entry (&outer_context_label_stack);
 
   /* Add the new sequence of catches to the main one for this function.  */
   push_to_sequence (catch_clauses);
index fc2c37b3dbb11b915450aff7cb1e7dc361f06565..8924a8f80f021a962cea7ee6648ae08463e4ebf2 100644 (file)
@@ -237,6 +237,11 @@ extern void check_exception_handler_labels PROTO((void));
 
 extern struct label_node *caught_return_label_stack;
 
+/* Keeps track of the label used as the context of a throw to rethrow an
+   exception to the outer exception region.  */
+
+extern struct label_node *outer_context_label_stack;
+
 /* A random area used for purposes elsewhere.  */
 
 extern struct label_node *false_label_stack;