diff options
author | Jason Merrill <jason@gcc.gnu.org> | 2002-04-03 19:11:00 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2002-04-03 19:11:00 -0500 |
commit | 659e5a7aa97fad95cccf792deb73810f906c1a80 (patch) | |
tree | e7c013fd4dcc1ce433e1cbcd41032def785b9193 /gcc/c-semantics.c | |
parent | 053d3344d411a28cb7d59ea924e7e81caa0255e8 (diff) | |
download | gcc-659e5a7aa97fad95cccf792deb73810f906c1a80.zip gcc-659e5a7aa97fad95cccf792deb73810f906c1a80.tar.gz gcc-659e5a7aa97fad95cccf792deb73810f906c1a80.tar.bz2 |
re PR c++/5636 (gcc-3.0.3, memory leakage: function that take a string as parameter will not call local variable destructors if exception is thrown.)
PR c++/5636
* tree.h (CLEANUP_EH_ONLY): New macro.
* stmt.c (expand_decl_cleanup_eh): New fn.
(expand_cleanups): Check CLEANUP_EH_ONLY.
* c-semantics.c (genrtl_decl_cleanup): Just take the CLEANUP_STMT.
Use expand_decl_cleanup_eh.
(expand_stmt): Adjust.
* c-common.h: Adjust prototype.
* cp/semantics.c (nullify_returns_r): Just set CLEANUP_EH_ONLY on
cleanup for nrv.
* except.c (struct eh_status): Remove protect_list.
(begin_protect_partials, end_protect_partials): Remove.
(add_partial_entry): Remove.
* except.h: Remove prototypes.
* expr.c (expand_expr) [WITH_CLEANUP_EXPR, TARGET_EXPR]: Use
expand_decl_cleanup_eh.
cp/:
* semantics.c (finish_eh_cleanup): New fn.
* cp-tree.h: Add prototype.
* init.c (perform_member_init, expand_cleanup_for_base): Use
finish_eh_cleanup.
* cp-tree.def (SUBOBJECT, CTOR_STMT): Remove.
* cp-tree.h: Remove references.
* decl.c (begin_constructor_body, end_constructor_body): Likewise.
* dump.c (cp_dump_tree): Likewise.
* pt.c (tsubst_expr): Likewise.
* semantics.c (genrtl_ctor_stmt, genrtl_subobject): Remove.
(cp_expand_stmt): Remove handling of CTOR_STMT and SUBOBJECT.
* tree.c (cp_statement_code_p): Likewise.
* init.c (build_new_1): Set CLEANUP_EH_ONLY on deleting cleanup.
From-SVN: r51827
Diffstat (limited to 'gcc/c-semantics.c')
-rw-r--r-- | gcc/c-semantics.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c index 3d8759d..030a04c 100644 --- a/gcc/c-semantics.c +++ b/gcc/c-semantics.c @@ -737,12 +737,12 @@ genrtl_asm_stmt (cv_qualifier, string, output_operands, /* Generate the RTL for a DECL_CLEANUP. */ void -genrtl_decl_cleanup (decl, cleanup) - tree decl; - tree cleanup; +genrtl_decl_cleanup (t) + tree t; { + tree decl = CLEANUP_DECL (t); if (!decl || (DECL_SIZE (decl) && TREE_TYPE (decl) != error_mark_node)) - expand_decl_cleanup (decl, cleanup); + expand_decl_cleanup_eh (decl, CLEANUP_EXPR (t), CLEANUP_EH_ONLY (t)); } /* We're about to expand T, a statement. Set up appropriate context @@ -848,7 +848,7 @@ expand_stmt (t) break; case CLEANUP_STMT: - genrtl_decl_cleanup (CLEANUP_DECL (t), CLEANUP_EXPR (t)); + genrtl_decl_cleanup (t); break; default: |