aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-09-20 17:40:57 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2005-09-20 17:40:57 +0200
commit96d84476fa03b60b5c63e179f68999cc894275c0 (patch)
treea2899af02839b4f40fd2efeaf6956341fb5bb3d3 /gcc
parent18c57f2c94753c87e076ae494f41c5105e939c9e (diff)
downloadgcc-96d84476fa03b60b5c63e179f68999cc894275c0.zip
gcc-96d84476fa03b60b5c63e179f68999cc894275c0.tar.gz
gcc-96d84476fa03b60b5c63e179f68999cc894275c0.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/rtti.c7
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/rtti/crash3.C10
4 files changed, 25 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0680431..5bdf8bd 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+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>
PR c++/23914
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 6d60d4c..8a3582d 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -1020,7 +1020,9 @@ get_pseudo_ti_init (tree type, unsigned tk_index)
tree base_binfo = BINFO_BASE_BINFO (TYPE_BINFO (type), 0);
tree tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo));
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);
}
@@ -1079,6 +1081,9 @@ get_pseudo_ti_init (tree type, unsigned tk_index)
base_inits = tree_cons (NULL_TREE,
build_int_cst (NULL_TREE, hint),
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);
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e456199..8dd65bb 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2005-09-20 Jakub Jelinek <jakub@redhat.com>
+ PR c++/23947
+ * g++.dg/rtti/crash3.C: New test.
+
PR tree-optimization/23818
* gcc.dg/pr23818.c: New test.
diff --git a/gcc/testsuite/g++.dg/rtti/crash3.C b/gcc/testsuite/g++.dg/rtti/crash3.C
new file mode 100644
index 0000000..076e360
--- /dev/null
+++ b/gcc/testsuite/g++.dg/rtti/crash3.C
@@ -0,0 +1,10 @@
+// PR c++/23947
+// { dg-do compile }
+
+class A {};
+class B {};
+class C : public A, public B {};
+class D : public C {};
+void f () throw (D)
+{
+}