Commit 25d8a217 by Nathan Froyd Committed by Nathan Froyd

class.c (build_vtbl_initializer): Adjust computation of new_position and which…

class.c (build_vtbl_initializer): Adjust computation of new_position and which entry to add padding for.

	* class.c (build_vtbl_initializer): Adjust computation of new_position
	and which entry to add padding for.

From-SVN: r160856
parent 616c557d
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> 2010-06-16 Jason Merrill <jason@redhat.com>
* except.c (check_noexcept_r): Return the problematic function. * except.c (check_noexcept_r): Return the problematic function.
......
...@@ -7607,14 +7607,15 @@ build_vtbl_initializer (tree binfo, ...@@ -7607,14 +7607,15 @@ build_vtbl_initializer (tree binfo,
ix--) ix--)
{ {
int j; 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); VEC_replace (constructor_elt, vid.inits, new_position, e);
for (j = 1; j < TARGET_VTABLE_DATA_ENTRY_DISTANCE; ++j) for (j = 1; j < TARGET_VTABLE_DATA_ENTRY_DISTANCE; ++j)
{ {
constructor_elt *f = VEC_index (constructor_elt, *inits, constructor_elt *f = VEC_index (constructor_elt, vid.inits,
new_position + j); new_position - j);
f->index = NULL_TREE; f->index = NULL_TREE;
f->value = build1 (NOP_EXPR, vtable_entry_type, f->value = build1 (NOP_EXPR, vtable_entry_type,
null_pointer_node); null_pointer_node);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment