Commit 96d84476 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/23947 (segv in reshape_init_r())

	PR c++/23947
	* rtti.c (get_pseudo_ti_init): Recompute ti pointer after
	get_tinfo_ptr calls.

	* g++.dg/rtti/crash3.C: New test.

From-SVN: r104456
parent 18c57f2c
2005-09-20 Jakub Jelinek <jakub@redhat.com>
PR c++/23947
* rtti.c (get_pseudo_ti_init): Recompute ti pointer after
get_tinfo_ptr calls.
2005-09-16 Mark Mitchell <mark@codesourcery.com> 2005-09-16 Mark Mitchell <mark@codesourcery.com>
PR c++/23914 PR c++/23914
......
...@@ -1021,6 +1021,8 @@ get_pseudo_ti_init (tree type, unsigned tk_index) ...@@ -1021,6 +1021,8 @@ get_pseudo_ti_init (tree type, unsigned tk_index)
tree tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo)); tree tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo));
tree base_inits = tree_cons (NULL_TREE, tinfo, NULL_TREE); tree base_inits = tree_cons (NULL_TREE, tinfo, NULL_TREE);
/* get_tinfo_ptr might have reallocated the tinfo_descs vector. */
ti = VEC_index (tinfo_s, tinfo_descs, tk_index);
return class_initializer (ti, type, base_inits); return class_initializer (ti, type, base_inits);
} }
...@@ -1079,6 +1081,9 @@ get_pseudo_ti_init (tree type, unsigned tk_index) ...@@ -1079,6 +1081,9 @@ get_pseudo_ti_init (tree type, unsigned tk_index)
base_inits = tree_cons (NULL_TREE, base_inits = tree_cons (NULL_TREE,
build_int_cst (NULL_TREE, hint), build_int_cst (NULL_TREE, hint),
base_inits); base_inits);
/* get_tinfo_ptr might have reallocated the tinfo_descs vector. */
ti = VEC_index (tinfo_s, tinfo_descs, tk_index);
return class_initializer (ti, type, base_inits); return class_initializer (ti, type, base_inits);
} }
} }
......
2005-09-20 Jakub Jelinek <jakub@redhat.com> 2005-09-20 Jakub Jelinek <jakub@redhat.com>
PR c++/23947
* g++.dg/rtti/crash3.C: New test.
PR tree-optimization/23818 PR tree-optimization/23818
* gcc.dg/pr23818.c: New test. * gcc.dg/pr23818.c: New test.
// PR c++/23947
// { dg-do compile }
class A {};
class B {};
class C : public A, public B {};
class D : public C {};
void f () throw (D)
{
}
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