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.
This commit is contained in:
Daniel Jacobowitz 2002-02-02 00:04:46 +00:00
parent c7d99d0b23
commit 76b79d6ec8
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,8 @@
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.
2002-02-01 Michael Snyder <msnyder@redhat.com> 2002-02-01 Michael Snyder <msnyder@redhat.com>
* breakpoint.c (create_temp_exception_breakpoint): Delete. * breakpoint.c (create_temp_exception_breakpoint): Delete.

View File

@ -318,7 +318,9 @@ gnuv3_virtual_fn_field (struct value **value_p,
/* Now value is an object of the appropriate base type. Fetch its /* Now value is an object of the appropriate base type. Fetch its
virtual table. */ virtual table. */
/* It might be possible to do this cast at the same time as the above. /* 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) if (TYPE_VPTR_BASETYPE (vfn_base) != vfn_base)
value = value_cast (TYPE_VPTR_BASETYPE (vfn_base), value); value = value_cast (TYPE_VPTR_BASETYPE (vfn_base), value);
vtable_address 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 = value_cast (lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j)),
vfn); 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; return vfn;
} }