aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/except.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-08-12 05:17:42 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-08-12 05:17:42 +0000
commitfbac6f3cf5a007c9888d1fecdd647338f9eb623f (patch)
tree22161d69312ee914b3ef780ef0a534744352e972 /gcc/cp/except.c
parent174283a3c26828ee2bf0acd05f6350f439beefcc (diff)
downloadgcc-fbac6f3cf5a007c9888d1fecdd647338f9eb623f.zip
gcc-fbac6f3cf5a007c9888d1fecdd647338f9eb623f.tar.gz
gcc-fbac6f3cf5a007c9888d1fecdd647338f9eb623f.tar.bz2
re PR c++/16698 (ICE with exceptions and declaration of __cxa_throw)
PR c++/16698 * except.c (build_throw): Allocate cleanup_type and the function for __cxa_throw separately. PR c++/16698 * g++.dg/eh/crash1.C: New test. From-SVN: r85850
Diffstat (limited to 'gcc/cp/except.c')
-rw-r--r--gcc/cp/except.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 91f9c87..b78cecd 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -611,18 +611,18 @@ build_throw (tree exp)
tree temp_expr, allocate_expr;
bool elided;
+ /* The CLEANUP_TYPE is the internal type of a destructor. */
+ if (!cleanup_type)
+ {
+ tmp = void_list_node;
+ tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
+ tmp = build_function_type (void_type_node, tmp);
+ cleanup_type = build_pointer_type (tmp);
+ }
+
fn = get_identifier ("__cxa_throw");
if (!get_global_value_if_present (fn, &fn))
{
- /* The CLEANUP_TYPE is the internal type of a destructor. */
- if (cleanup_type == NULL_TREE)
- {
- tmp = void_list_node;
- tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
- tmp = build_function_type (void_type_node, tmp);
- cleanup_type = build_pointer_type (tmp);
- }
-
/* Declare void __cxa_throw (void*, void*, void (*)(void*)). */
/* ??? Second argument is supposed to be "std::type_info*". */
tmp = void_list_node;
@@ -632,7 +632,7 @@ build_throw (tree exp)
tmp = build_function_type (void_type_node, tmp);
fn = push_throw_library_fn (fn, tmp);
}
-
+
/* throw expression */
/* First, decay it. */
exp = decay_conversion (exp);