]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
except.c (expand_start_catch_block): suspend_momentary for the terminate handler.
authorJason Merrill <jason@yorick.cygnus.com>
Fri, 19 Dec 1997 08:34:04 +0000 (08:34 +0000)
committerJeff Law <law@gcc.gnu.org>
Fri, 19 Dec 1997 08:34:04 +0000 (01:34 -0700)
        * except.c (expand_start_catch_block): suspend_momentary for the
        terminate handler.
Critical EH bugfix for egcs-1.0.1.

From-SVN: r17147

gcc/cp/ChangeLog
gcc/cp/except.c

index 5275663fe1533f6a9c1160c5674aa14e42219fab..a6c118c93cc302a68b49148c4a1859c34ed1f35b 100644 (file)
@@ -1,3 +1,8 @@
+Fri Dec 19 09:37:26 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * except.c (expand_start_catch_block): suspend_momentary for the
+       terminate handler.
+
 Thu Nov 27 09:39:31 1997  Jason Merrill  <jason@yorick.cygnus.com>
 
        * except.c: Call terminate without caching so many bits.
index bad75bd5e28a7bce4e12cbade4826d734b9b85ed..65eaf8ae52d434ccdc0b538b5e8ad2c4a5819164 100644 (file)
@@ -645,12 +645,15 @@ expand_start_catch_block (declspecs, declarator)
          must call terminate.  See eh23.C.  */
       if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl)))
        {
+         int yes = suspend_momentary ();
+         tree term = build_function_call (Terminate, NULL_TREE);
+         resume_momentary (yes);
+
          /* Generate the copy constructor call directly so we can wrap it.
             See also expand_default_init.  */
          init = ocp_convert (TREE_TYPE (decl), init,
                              CONV_IMPLICIT|CONV_FORCE_TEMP, 0);
-         init = build (TRY_CATCH_EXPR, TREE_TYPE (init), init,
-                       build_function_call (Terminate, NULL_TREE));
+         init = build (TRY_CATCH_EXPR, TREE_TYPE (init), init, term);
        }
 
       /* Let `cp_finish_decl' know that this initializer is ok.  */