This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Funky code in gnuv2_virtual_fn_field
- To: Daniel Berlin <dan at cgsoftware dot com>
- Subject: Funky code in gnuv2_virtual_fn_field
- From: Jim Blandy <jimb at zwingli dot cygnus dot com>
- Date: Sun, 20 May 2001 11:01:59 -0500 (EST)
- Cc: gdb at sources dot redhat dot com
I'm looking at lines 112--118 in gnu-v2-abi.c:
if (TYPE_TARGET_TYPE (context) != type1)
{
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));
}
This looks fishy to me. If we smash the POINTED_TO_OFFSET without
smashing the ENCLOSING_TYPE in a corresponding manner, and then we
indirect through that pointer, don't we get a value whose
ENCLOSING_TYPE is set, but whose address points to the embedded
object, and not the enclosing object?