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.
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)
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);
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)