diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-14 10:48:20 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-14 10:48:20 +0000 |
commit | 43980eb65ff268c6af725b52b34fdabb20cb3568 (patch) | |
tree | 322737c6515bacad42496cb0c3a64e2f9e772372 /gcc/cp | |
parent | f02b4a51b4b8903da562f0a5cd72e5ced117a321 (diff) | |
download | gcc-43980eb65ff268c6af725b52b34fdabb20cb3568.tar.gz |
cp:
* class.c (dfs_accumulate_vtbl_inits): For case 2 & 3, make sure
we've not emerged from the hierarchy of RTTI_BINFO on reaching
a non-virtual base.
testsuite:
* g++.old-deja/g++.abi/vbase8-9.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43368 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/class.c | 24 |
2 files changed, 27 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ee62669ae6c..f02f7fa8ced 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2001-06-14 Nathan Sidwell <nathan@codesourcery.com> + + * class.c (dfs_accumulate_vtbl_inits): For case 2 & 3, make sure + we've not emerged from the hierarchy of RTTI_BINFO on reaching + a non-virtual base. + 2001-06-13 Mark Mitchell <mark@codesourcery.com> * NEWS: Update release number. diff --git a/gcc/cp/class.c b/gcc/cp/class.c index c1347b3cb33..1fbf8d04e68 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -7564,7 +7564,7 @@ accumulate_vtbl_inits (binfo, orig_binfo, rtti_binfo, t, inits) BINFO_TYPE (orig_binfo)), 20000517); - /* If it doesn't have a vpte, we don't do anything. */ + /* If it doesn't have a vptr, we don't do anything. */ if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo))) return; @@ -7675,14 +7675,32 @@ dfs_accumulate_vtbl_inits (binfo, orig_binfo, rtti_binfo, t, l) still be primary to something within a lost primary virtual base of RTTI_BINFO. */ tree b; - tree last, orig_last; + tree last = binfo; + tree orig_last = orig_binfo; /* First, look through the bases we are primary to for a virtual base. */ - for (b = BINFO_PRIMARY_BASE_OF (binfo), orig_last = orig_binfo; + for (b = BINFO_PRIMARY_BASE_OF (binfo); b; b = BINFO_PRIMARY_BASE_OF (b)) { + if (!TREE_VIA_VIRTUAL (b)) + { + /* See if B is still within the hierarchy starting + at RTTI_BINFO. */ + tree probe; + + for (probe = b; probe; + probe = BINFO_INHERITANCE_CHAIN (probe)) + if (probe == rtti_binfo) + break; + if (!probe) + { + b = NULL_TREE; + break; + } + } + last = b; if (orig_last) orig_last = BINFO_PRIMARY_BASE_OF (orig_last); |