+2001-06-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ * class.c (layout_vtable_decl): Fix off by one error on
+ build_index_type.
+ (build_vtt): Likewise.
+ (build_ctor_vtbl_group): Likewise.
+
2001-06-05 Nathan Sidwell <nathan@codesourcery.com>
* class.c (maybe_indent_hierarchy): New function.
tree binfo;
int n;
{
- tree itype;
tree atype;
tree vtable;
- itype = size_int (n);
atype = build_cplus_array_type (vtable_entry_type,
- build_index_type (itype));
+ build_index_type (size_int (n - 1)));
layout_type (atype);
/* We may have to grow the vtable. */
TYPE_ALIGN (t) = MAX (TYPE_ALIGN (t), BITS_PER_UNIT);
/* Go through the virtual bases, allocating space for each virtual
- base that is not already a primary base class. Under the new
+ base that is not already a primary base class. Under the old
ABI, these are allocated according to a depth-first left-to-right
postorder traversal; in the new ABI, inheritance graph order is
used instead. */
return;
/* Figure out the type of the VTT. */
- type = build_index_type (size_int (list_length (inits)));
+ type = build_index_type (size_int (list_length (inits) - 1));
type = build_cplus_array_type (const_ptr_type_node, type);
/* Now, build the VTT object itself. */
inits = TREE_VALUE (list);
/* Figure out the type of the construction vtable. */
- type = build_index_type (size_int (list_length (inits)));
+ type = build_index_type (size_int (list_length (inits) - 1));
type = build_cplus_array_type (vtable_entry_type, type);
TREE_TYPE (vtbl) = type;