Re: [rfc/cp] method stub assertions

Daniel Jacobowitz
2004-01-05T01:56:14Z

On Sun, Jan 04, 2004 at 07:50:48PM -0500, Michael Chastain wrote:
> I'm working on support for hp-ux aCC.

Good luck :)

I'll re-read your analysis tomorrow when I'm more awake, but:

> *************** evaluate_subexp_standard (struct type *e
> *** 996,1006 ****
> if (METHOD_PTR_IS_VIRTUAL (fnptr))
> {
> int fnoffset = METHOD_PTR_TO_VOFFSET (fnptr);
> ! struct type *basetype;
> struct type *domain_type =
> ! TYPE_DOMAIN_TYPE (TYPE_TARGET_TYPE (VALUE_TYPE (arg1)));
> int i, j;
> ! basetype = TYPE_TARGET_TYPE (VALUE_TYPE (arg2));
> if (domain_type != basetype)
> arg2 = value_cast (lookup_pointer_type (domain_type), arg2);
> basetype = TYPE_VPTR_BASETYPE (domain_type);
> --- 997,1011 ----
> if (METHOD_PTR_IS_VIRTUAL (fnptr))
> {
> int fnoffset = METHOD_PTR_TO_VOFFSET (fnptr);
> ! struct type *basetype =
> ! basetype = TYPE_TARGET_TYPE (VALUE_TYPE (arg2));
> struct type *domain_type =
> ! TYPE_DOMAIN_TYPE (TYPE_TARGET_TYPE (VALUE_TYPE (arg1)));
> int i, j;
> !
> ! gdb_assert (basetype != NULL);
> ! gdb_assert (domain_type != NULL);
> !
> if (domain_type != basetype)
> arg2 = value_cast (lookup_pointer_type (domain_type), arg2);
> basetype = TYPE_VPTR_BASETYPE (domain_type);
>

I was trying to figure out what you changed here and why the diff
seemed confusing. Take another look at the new definition of basetype;
you added a typo.