aboutsummaryrefslogtreecommitdiff
path: root/gdb/values.c
diff options
context:
space:
mode:
authorMark Alexander <marka@cygnus>1999-01-18 16:43:01 +0000
committerMark Alexander <marka@cygnus>1999-01-18 16:43:01 +0000
commita396d2bd0d9e011456b016ef09ff370e2da2c323 (patch)
treed4353a91efbd24f9cc7cb84100518a7426edf484 /gdb/values.c
parentf9a5267ce6d01af13abd9c330761749c751d1760 (diff)
downloadgdb-a396d2bd0d9e011456b016ef09ff370e2da2c323.zip
gdb-a396d2bd0d9e011456b016ef09ff370e2da2c323.tar.gz
gdb-a396d2bd0d9e011456b016ef09ff370e2da2c323.tar.bz2
* values.c (value_virtual_fn_field): Clear the pointed-to
offset when casting to the base class.
Diffstat (limited to 'gdb/values.c')
-rw-r--r--gdb/values.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/values.c b/gdb/values.c
index 7b6dd6b..c7053b8 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));
}