diff options
author | froydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-16 18:07:09 +0000 |
---|---|---|
committer | froydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-16 18:07:09 +0000 |
commit | 7c15eccdd8f2b2b1399f74262310676e559074c7 (patch) | |
tree | 462465a6ecf27f01c0f90b36c3dc45ab946d9aa5 /gcc/cp | |
parent | 7d277281bbb6271dcbc0c7ee34f19cea86681225 (diff) | |
download | gcc-7c15eccdd8f2b2b1399f74262310676e559074c7.tar.gz |
* class.c (build_vtbl_initializer): Adjust computation of new_position
and which entry to add padding for.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160856 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/class.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8402afd176e..7456c82eee5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2010-06-16 Nathan Froyd <froydnj@codesourcery.com> + + * class.c (build_vtbl_initializer): Adjust computation of new_position + and which entry to add padding for. + 2010-06-16 Jason Merrill <jason@redhat.com> * except.c (check_noexcept_r): Return the problematic function. diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 60908ffb5d5..f945923ddc4 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -7607,14 +7607,15 @@ build_vtbl_initializer (tree binfo, ix--) { int j; - int new_position = TARGET_VTABLE_DATA_ENTRY_DISTANCE * ix; + int new_position = (TARGET_VTABLE_DATA_ENTRY_DISTANCE * ix + + (TARGET_VTABLE_DATA_ENTRY_DISTANCE - 1)); VEC_replace (constructor_elt, vid.inits, new_position, e); for (j = 1; j < TARGET_VTABLE_DATA_ENTRY_DISTANCE; ++j) { - constructor_elt *f = VEC_index (constructor_elt, *inits, - new_position + j); + constructor_elt *f = VEC_index (constructor_elt, vid.inits, + new_position - j); f->index = NULL_TREE; f->value = build1 (NOP_EXPR, vtable_entry_type, null_pointer_node); |