Branch: Tag:

2014-08-16

2014-08-16 21:23:31 by Martin Nilsson <nilsson@opera.com>

Returning UNDEFINED from cast() now produces an exception.

261:    Pike_error("Cast failed, wanted int, got %s\n",    get_name_of_type(TYPEOF(sp[-1])));    } +  else if(SUBTYPEOF(sp[-1]) == NUMBER_UNDEFINED) +  Pike_error("Cannot cast this object to int.\n");    }       break;
342:       if(TYPEOF(sp[-1]) != PIKE_T_STRING)    { +  if(TYPEOF(sp[-1])==PIKE_T_INT && SUBTYPEOF(sp[-1])==NUMBER_UNDEFINED) +  Pike_error("Cannot cast this object to string.\n");    if(TYPEOF(sp[-1]) == T_OBJECT && sp[-1].u.object->prog)    {    struct object *o = sp[-1].u.object;
725:    }    }    +  if(TYPEOF(sp[-1]) == T_INT && +  SUBTYPEOF(sp[-1]) == NUMBER_UNDEFINED) +  Pike_error("Cannot cast this object to %s.\n", +  get_name_of_type(type->type)); +     if(run_time_type != TYPEOF(sp[-1]))    {    switch(TYPEOF(sp[-1])) {