diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-05 11:53:28 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-05 11:53:28 +0000 |
commit | 82ef7cb53c54e23bbe348addc4c390e0e59e41e5 (patch) | |
tree | 86f50160cba50c6a3342b93a23ad1e2d220158b8 /gcc/cp | |
parent | 99e762b3b080623c8c5215c7a4bcafcc0792f920 (diff) | |
download | gcc-82ef7cb53c54e23bbe348addc4c390e0e59e41e5.tar.gz |
* class.c (layout_vtable_decl): Fix off by one error on
build_index_type.
(build_vtt): Likewise.
(build_ctor_vtbl_group): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42903 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/class.c | 10 |
2 files changed, 11 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8f5ebaa69ea..94658acc1ce 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,12 @@ 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. (dump_class_hierarchy_r): Add flags. Dump extra binfo information, if enabled. Use maybe_indent_hierarchy. Adjust diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 7a7f69b0b7d..afe2da403f7 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -2446,13 +2446,11 @@ layout_vtable_decl (binfo, n) 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. */ @@ -4856,7 +4854,7 @@ layout_virtual_bases (t, offsets) 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. */ @@ -7149,7 +7147,7 @@ build_vtt (t) 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. */ @@ -7468,7 +7466,7 @@ build_ctor_vtbl_group (binfo, t) 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; |