From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Blandy To: Daniel Berlin Cc: gdb@sources.redhat.com Subject: Funky code in gnuv2_virtual_fn_field Date: Sun, 20 May 2001 13:06:00 -0000 Message-id: <20010520160159.3484E5E9DB@zwingli.cygnus.com> X-SW-Source: 2001-05/msg00305.html 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?