* gdbtypes.c (fill_in_vptr_fieldno): Don't ignore the first

baseclass--we don't always inherit its virtual function table
	pointer.
This commit is contained in:
Michael Tiemann 1993-02-01 01:11:17 +00:00
parent 271e50309b
commit edf67bd181
2 changed files with 14 additions and 4 deletions

View File

@ -1,5 +1,9 @@
Sun Jan 31 04:32:48 1993 Michael Tiemann (tiemann@rtl.cygnus.com)
* gdbtypes.c (fill_in_vptr_fieldno): Don't ignore the first
baseclass--we don't always inherit its virtual function table
pointer.
* eval.c (evaluate_subexp): In OP_FUNCALL case, adjust `this'
pointer correctly in case value_struct_elt moves it around.

View File

@ -690,9 +690,9 @@ lookup_template_type (name, type, block)
return (SYMBOL_TYPE (sym));
}
/* Given a type TYPE, lookup the type of the component of type named
NAME.
If NOERR is nonzero, return zero if NAME is not suitably defined. */
/* Given a type TYPE, lookup the type of the component of type named NAME.
If NOERR is nonzero, return zero if NAME is not suitably defined.
If NAME is the name of a baseclass type, return that type. */
struct type *
lookup_struct_elt_type (type, name, noerr)
@ -718,6 +718,9 @@ lookup_struct_elt_type (type, name, noerr)
check_stub_type (type);
if (STREQ (type_name_no_tag (type), name))
return type;
for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
{
char *t_field_name = TYPE_FIELD_NAME (type, i);
@ -765,7 +768,10 @@ fill_in_vptr_fieldno (type)
if (TYPE_VPTR_FIELDNO (type) < 0)
{
int i;
for (i = 1; i < TYPE_N_BASECLASSES (type); i++)
/* We must start at zero in case the first (and only) baseclass is
virtual (and hence we cannot share the table pointer). */
for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
{
fill_in_vptr_fieldno (TYPE_BASECLASS (type, i));
if (TYPE_VPTR_FIELDNO (TYPE_BASECLASS (type, i)) >= 0)