From a396d2bd0d9e011456b016ef09ff370e2da2c323 Mon Sep 17 00:00:00 2001 From: Mark Alexander Date: Mon, 18 Jan 1999 16:43:01 +0000 Subject: [PATCH] * values.c (value_virtual_fn_field): Clear the pointed-to offset when casting to the base class. --- gdb/ChangeLog | 5 +++++ gdb/values.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 58589d126f2..c6a234f8bca 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +Mon Jan 18 08:38:05 1999 Mark Alexander + + * 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 * remote-udi.c (init_udi_ops): change non-existant udi_run_ops to diff --git a/gdb/values.c b/gdb/values.c index 7b6dd6b9e7d..c7053b8df78 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -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)); } -- 2.30.2