Commit fbac6f3c by Mark Mitchell Committed by Mark Mitchell

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
parent 174283a3
2004-08-11 Mark Mitchell <mark@codesourcery.com> 2004-08-11 Mark Mitchell <mark@codesourcery.com>
PR c++/16698
* except.c (build_throw): Allocate cleanup_type and the function
for __cxa_throw separately.
PR c++/16853 PR c++/16853
* call.c (standard_conversion): Do not accept conversions between * call.c (standard_conversion): Do not accept conversions between
pointers to members if the class types are unrelated. pointers to members if the class types are unrelated.
......
...@@ -611,18 +611,18 @@ build_throw (tree exp) ...@@ -611,18 +611,18 @@ build_throw (tree exp)
tree temp_expr, allocate_expr; tree temp_expr, allocate_expr;
bool elided; 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"); fn = get_identifier ("__cxa_throw");
if (!get_global_value_if_present (fn, &fn)) 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*)). */ /* Declare void __cxa_throw (void*, void*, void (*)(void*)). */
/* ??? Second argument is supposed to be "std::type_info*". */ /* ??? Second argument is supposed to be "std::type_info*". */
tmp = void_list_node; tmp = void_list_node;
...@@ -632,7 +632,7 @@ build_throw (tree exp) ...@@ -632,7 +632,7 @@ build_throw (tree exp)
tmp = build_function_type (void_type_node, tmp); tmp = build_function_type (void_type_node, tmp);
fn = push_throw_library_fn (fn, tmp); fn = push_throw_library_fn (fn, tmp);
} }
/* throw expression */ /* throw expression */
/* First, decay it. */ /* First, decay it. */
exp = decay_conversion (exp); exp = decay_conversion (exp);
......
2004-08-11 Mark Mitchell <mark@codesourcery.com> 2004-08-11 Mark Mitchell <mark@codesourcery.com>
PR c++/16698
* g++.dg/eh/crash1.C: New test.
PR c++/16717 PR c++/16717
* g++.dg/ext/construct1.C: New test. * g++.dg/ext/construct1.C: New test.
......
extern "C" void __cxa_throw (void *, void *, void (*) (void *) );
void foo(){
throw 1;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment