This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Funky code in gnuv2_virtual_fn_field



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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]