aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2002-09-29 18:27:02 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2002-09-29 18:27:02 +0000
commit03357c23e9f17042271ed66fa2c2ed2dbd878690 (patch)
tree65d80f32f22a69eb15dcf15107e0d80b896c21c5 /gcc/cp
parent6ca6193b8250bcef3a3180246e7507a197355f52 (diff)
downloadgcc-03357c23e9f17042271ed66fa2c2ed2dbd878690.zip
gcc-03357c23e9f17042271ed66fa2c2ed2dbd878690.tar.gz
gcc-03357c23e9f17042271ed66fa2c2ed2dbd878690.tar.bz2
re PR c++/7788 (g++-3.2 internal error: Segmentation fault)
cp: PR c++/7788 * rtti.c (unemitted_tinfo_decl_p): Check it has a field. testsuite: * g++.dg/rtti/crash1.C: New test. From-SVN: r57630
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/rtti.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e3265e4..792ce89 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2002-09-29 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/7788
+ * rtti.c (unemitted_tinfo_decl_p): Check it has a field.
+
2002-09-29 Kazu Hirata <kazu@cs.umass.edu>
* cp-tree.h: Fix comment typos.
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 6d6e818..1d692fc 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -1419,11 +1419,13 @@ unemitted_tinfo_decl_p (t, data)
TREE_CODE (t) == VAR_DECL
/* whos name points back to itself */
&& IDENTIFIER_GLOBAL_VALUE (DECL_NAME (t)) == t
- /* whos name's type is non-null */
+ /* whose name's type is non-null */
&& TREE_TYPE (DECL_NAME (t))
- /* and whos type is a struct */
+ /* and whose type is a struct */
&& TREE_CODE (TREE_TYPE (t)) == RECORD_TYPE
- /* with a first field of our pseudo type info */
+ /* with a field */
+ && TYPE_FIELDS (TREE_TYPE (t))
+ /* which is our pseudo type info */
&& TREE_TYPE (TYPE_FIELDS (TREE_TYPE (t))) == ti_desc_type_node)
return 1;
return 0;