mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-03-01 13:26:47 +08:00
* gnu-v3-abi.c (gnuv3_baseclass_offset): Check whether
TYPE_VPTR_FIELDNO is valid.
This commit is contained in:
parent
eb0d3137b1
commit
7ed85d2635
@ -1,3 +1,8 @@
|
||||
2003-08-22 Daniel Jacobowitz <drow@mvista.com>
|
||||
|
||||
* gnu-v3-abi.c (gnuv3_baseclass_offset): Check whether
|
||||
TYPE_VPTR_FIELDNO is valid.
|
||||
|
||||
2003-08-19 Mark Kettenis <kettenis@gnu.org>
|
||||
|
||||
* utils.c (set_width_command): Remove prototypes.
|
||||
|
@ -412,10 +412,15 @@ gnuv3_baseclass_offset (struct type *type, int index, char *valaddr,
|
||||
v3 C++ ABI Section 2.4.I.2.b. Fortunately the ABI guarantees that the
|
||||
vtable pointer will be located at the beginning of the object, so we can
|
||||
bypass the casting. Verify that the TYPE_VPTR_FIELDNO is in fact at the
|
||||
start of whichever baseclass it resides in, as a sanity measure. */
|
||||
start of whichever baseclass it resides in, as a sanity measure - iff
|
||||
we have debugging information for that baseclass. */
|
||||
|
||||
vbasetype = TYPE_VPTR_BASETYPE (type);
|
||||
if (TYPE_FIELD_BITPOS (vbasetype, TYPE_VPTR_FIELDNO (vbasetype)) != 0)
|
||||
if (TYPE_VPTR_FIELDNO (vbasetype) < 0)
|
||||
fill_in_vptr_fieldno (vbasetype);
|
||||
|
||||
if (TYPE_VPTR_FIELDNO (vbasetype) >= 0
|
||||
&& TYPE_FIELD_BITPOS (vbasetype, TYPE_VPTR_FIELDNO (vbasetype)) != 0)
|
||||
error ("Illegal vptr offset in class %s",
|
||||
TYPE_NAME (vbasetype) ? TYPE_NAME (vbasetype) : "<unknown>");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user