aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/except.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/except.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/except.c')
-rw-r--r--gcc/cp/except.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index ff7a45b..56b2a41 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -614,6 +614,13 @@ expand_start_catch_block (declspecs, declarator)
init_type = build_reference_type (init_type);
exp = get_eh_value ();
+
+ /* Since pointers are passed by value, initialize a reference to
+ pointer catch parm with the address of the value slot. */
+ if (TREE_CODE (init_type) == REFERENCE_TYPE
+ && TREE_CODE (TREE_TYPE (init_type)) == POINTER_TYPE)
+ exp = build_unary_op (ADDR_EXPR, exp, 1);
+
exp = expr_tree_cons (NULL_TREE,
build_eh_type_type (TREE_TYPE (decl)),
expr_tree_cons (NULL_TREE,