diff options
author | Daniel Jacobowitz <dan@debian.org> | 2002-02-02 00:04:46 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2002-02-02 00:04:46 +0000 |
commit | 9c1b09fc53943ce1a713163915cc12d4bb9e65d7 (patch) | |
tree | d3148bb83aa4fa6a04ca8dcd9fc3dd2a8e90a992 /gdb/gnu-v3-abi.c | |
parent | 43c08cf28b1a2dc40ce41f5bb57c6b658a763efe (diff) | |
download | gdb-9c1b09fc53943ce1a713163915cc12d4bb9e65d7.tar.gz |
2002-02-01 Daniel Jacobowitz <drow@mvista.com>
* gnu-v3-abi.c (gnuv3_virtual_fn_field): Update comments.
Update ``this'' pointer when calling virtual functions.
Diffstat (limited to 'gdb/gnu-v3-abi.c')
-rw-r--r-- | gdb/gnu-v3-abi.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index a4c79605000..ae2104d59c4 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -318,7 +318,9 @@ gnuv3_virtual_fn_field (struct value **value_p, /* Now value is an object of the appropriate base type. Fetch its virtual table. */ /* It might be possible to do this cast at the same time as the above. - Does multiple inheritance affect this? */ + Does multiple inheritance affect this? + Can this even trigger, or is TYPE_VPTR_BASETYPE idempotent? + */ if (TYPE_VPTR_BASETYPE (vfn_base) != vfn_base) value = value_cast (TYPE_VPTR_BASETYPE (vfn_base), value); vtable_address @@ -337,6 +339,10 @@ gnuv3_virtual_fn_field (struct value **value_p, vfn = value_cast (lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j)), vfn); + /* Is (type)value always numerically the same as (vfn_base)value? + If so we can spare this cast and use one of the ones above. */ + *value_p = value_addr (value_cast (type, *value_p)); + return vfn; } |