diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-29 18:27:02 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-29 18:27:02 +0000 |
commit | accfba65f5fc346d49bcd7ae27392660d69c031d (patch) | |
tree | 65d80f32f22a69eb15dcf15107e0d80b896c21c5 /gcc | |
parent | 804e9c9156d0930344e4dea29d7cc7cfa85a2dfd (diff) | |
download | ppe42-gcc-accfba65f5fc346d49bcd7ae27392660d69c031d.tar.gz ppe42-gcc-accfba65f5fc346d49bcd7ae27392660d69c031d.zip |
cp:
PR c++/7788
* rtti.c (unemitted_tinfo_decl_p): Check it has a field.
testsuite:
* g++.dg/rtti/crash1.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57630 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/rtti.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/rtti/crash1.C | 10 |
4 files changed, 24 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e3265e41557..792ce89cd61 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 6d6e8189862..1d692fc4793 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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 46400b6191a..cc3219be00f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2002-09-29 Nathan Sidwell <nathan@codesourcery.com> + + * g++.dg/rtti/crash1.C: New test. + 2002-09-29 Hans-Peter Nilsson <hp@bitrange.com> * gcc.dg/sibcall-1.c, gcc.dg/sibcall-2.c, gcc.dg/sibcall-3.c, diff --git a/gcc/testsuite/g++.dg/rtti/crash1.C b/gcc/testsuite/g++.dg/rtti/crash1.C new file mode 100644 index 00000000000..eea6a3950de --- /dev/null +++ b/gcc/testsuite/g++.dg/rtti/crash1.C @@ -0,0 +1,10 @@ +// { dg-do compile } + +// Copyright (C) 2002 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 29 Sep 2002 <nathan@codesourcery.com> + +// PR 7788. ICE + +class foo; +extern const foo bar; +class bar; |