]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix PR gdb/778
authorDaniel Jacobowitz <drow@false.org>
Wed, 2 Oct 2002 22:09:01 +0000 (22:09 +0000)
committerDaniel Jacobowitz <drow@false.org>
Wed, 2 Oct 2002 22:09:01 +0000 (22:09 +0000)
        * gdbtypes.c (fill_in_vptr_fieldno): Call check_typedef
        before recursing.
        * gnu-v3-abi.c (gnuv3_virtual_fn_field): Check return value
        of fill_in_vptr_fieldno.

gdb/ChangeLog
gdb/gdbtypes.c
gdb/gnu-v3-abi.c

index 30200b2ac2078fd56e71c0c810d36850841d5b20..cfde49692a9519147fca50ef25e5ea02e144a8e0 100644 (file)
@@ -1,3 +1,11 @@
+2002-10-02  Daniel Jacobowitz  <drow@mvista.com>
+
+       Fix PR gdb/778
+       * gdbtypes.c (fill_in_vptr_fieldno): Call check_typedef
+       before recursing.
+       * gnu-v3-abi.c (gnuv3_virtual_fn_field): Check return value
+       of fill_in_vptr_fieldno.
+
 2002-10-01  Alexandre Oliva  <aoliva@redhat.com>
 
        * mips-tdep.c (mips_find_abi_section): .mdebug.abi64 is the name
index 6ebbf2db1b619fff28ff2516a1e549cde7eaa528..121fcbe4eaaa5713ce7ed3521ebacb9ca5931b71 100644 (file)
@@ -1276,13 +1276,12 @@ fill_in_vptr_fieldno (struct type *type)
          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)
+         struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
+         fill_in_vptr_fieldno (baseclass);
+         if (TYPE_VPTR_FIELDNO (baseclass) >= 0)
            {
-             TYPE_VPTR_FIELDNO (type)
-               = TYPE_VPTR_FIELDNO (TYPE_BASECLASS (type, i));
-             TYPE_VPTR_BASETYPE (type)
-               = TYPE_VPTR_BASETYPE (TYPE_BASECLASS (type, i));
+             TYPE_VPTR_FIELDNO (type) = TYPE_VPTR_FIELDNO (baseclass);
+             TYPE_VPTR_BASETYPE (type) = TYPE_VPTR_BASETYPE (baseclass);
              break;
            }
        }
index fbab8af0a18595a6e2575cd0d8d4956c710eedb5..2b4e01a78a4e21ebfe69cbc8d7d08c802461d259 100644 (file)
@@ -324,6 +324,9 @@ gnuv3_virtual_fn_field (struct value **value_p,
      type now.  */
   if (TYPE_VPTR_FIELDNO (vfn_base) < 0)
     fill_in_vptr_fieldno (vfn_base);
+  if (TYPE_VPTR_FIELDNO (vfn_base) < 0)
+    error ("Could not find virtual table pointer for class \"%s\".",
+          TYPE_TAG_NAME (vfn_base) ? TYPE_TAG_NAME (vfn_base) : "<unknown>");
 
   /* Now that we know which base class is defining our virtual
      function, cast our value to that baseclass.  This takes care of