aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1997-11-26 09:15:09 +0000
committerJason Merrill <jason@gcc.gnu.org>1997-11-26 04:15:09 -0500
commit92f5c1350c047cd68cdb17e66ed5f52d51b019b0 (patch)
tree0b01efe391453133f242ff039511260f69ca9c2c /gcc/cp/init.c
parentf47448072a99ebd168eddf9b7ed627518f5e9470 (diff)
downloadgcc-92f5c1350c047cd68cdb17e66ed5f52d51b019b0.zip
gcc-92f5c1350c047cd68cdb17e66ed5f52d51b019b0.tar.gz
gcc-92f5c1350c047cd68cdb17e66ed5f52d51b019b0.tar.bz2
except.c (expand_start_catch_block): Fix catching a reference to pointer.
* except.c (expand_start_catch_block): Fix catching a reference to pointer. * init.c (build_new): Copy size to the saveable obstack. * init.c (build_new): Stick a CLEANUP_POINT_EXPR inside the TRY_CATCH_EXPR for now. From-SVN: r16726
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 7100b565..186b6c3 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -2736,12 +2736,19 @@ build_new (placement, decl, init, use_global_new)
if (placement)
flags |= LOOKUP_SPECULATIVELY;
+ /* Copy size to the saveable obstack. */
+ size = copy_node (size);
+
cleanup = build_op_delete_call (dcode, alloc_expr, size, flags);
resume_momentary (yes);
if (cleanup)
{
+ /* FIXME: this is a workaround for a crash due to overlapping
+ exception regions. Cleanups shouldn't really happen here. */
+ rval = build1 (CLEANUP_POINT_EXPR, TREE_TYPE (rval), rval);
+
rval = build (TRY_CATCH_EXPR, TREE_TYPE (rval), rval, cleanup);
rval = build (COMPOUND_EXPR, TREE_TYPE (rval), alloc_expr, rval);
}