* values.c (value_virtual_fn_field): Clear the pointed-to
authorMark Alexander <marka@cygnus>
Mon, 18 Jan 1999 16:43:01 +0000 (16:43 +0000)
committerMark Alexander <marka@cygnus>
Mon, 18 Jan 1999 16:43:01 +0000 (16:43 +0000)
offset when casting to the base class.

gdb/ChangeLog
gdb/values.c

index 58589d126f216eab63b088eefcede5b008abec33..c6a234f8bca730c112af0e43349f602ba556cb6c 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jan 18 08:38:05 1999  Mark Alexander  <marka@cygnus.com>
+
+       * values.c (value_virtual_fn_field): Clear the pointed-to
+       offset when casting to the base class.
+
 Mon Jan 18 10:30:51 1999  David Taylor  <taylor@texas.cygnus.com>
 
        * remote-udi.c (init_udi_ops): change non-existant udi_run_ops to
index 7b6dd6b9e7de3b10f0e5759f74ad8f56d769b7e0..c7053b8df789a72bb8fb8d3114d50cd4252fbc30 100644 (file)
@@ -1025,7 +1025,9 @@ value_virtual_fn_field (arg1p, f, j, type, offset)
       /* Now context is a pointer to the basetype containing the vtbl.  */
       if (TYPE_TARGET_TYPE (context) != type1)
         {
-          arg1 = value_ind (value_cast (context, value_addr (arg1)));
+         value_ptr tmp = value_cast (context, value_addr (arg1));
+         VALUE_POINTED_TO_OFFSET (tmp) = 0;
+          arg1 = value_ind (tmp);
           type1 = check_typedef (VALUE_TYPE (arg1));
         }