Branch: Tag:

2016-05-18

2016-05-18 14:50:22 by Per Hedbor <ph@opera.com>

More correct handling of various cases for **

3789:    /* fallthrough again (this is the slow path).. */       case TWO_TYPES(T_OBJECT,T_INT): +  case TWO_TYPES(T_OBJECT,T_FLOAT):    case TWO_TYPES(T_OBJECT,T_OBJECT): -  +  case TWO_TYPES(T_INT,T_OBJECT): +  case TWO_TYPES(T_FLOAT,T_OBJECT):    if( !call_lfun( LFUN_POW, LFUN_RPOW ) ) -  Pike_error("Illegal argument 1 to `**.\n"); +  { +  if( TYPEOF(sp[-2]) != PIKE_T_OBJECT ) +  { +  stack_swap(); +  convert_stack_top_to_bignum(); +  stack_swap(); +  if( call_lfun( LFUN_POW, LFUN_RPOW ) )    return;    } -  +  Pike_error("Illegal argument 1 to `** (object missing implementation of `**).\n");    } -  +  return; +  } + }         /*! @decl mixed `*(mixed arg1)
5929:    "function(string,float:string)    */    ADD_EFUN2("`**", f_exponent, -  tOr4(tFunc(tInt tInt,tInt), +  tOr7(tFunc(tInt tInt,tInt),    tFunc(tFloat tFloat, tFloat), -  +  tFunc(tOr(tInt,tFloat) tObj, tOr3(tFloat,tInt,tFloat)),    tFunc(tInt tFloat, tFloat), -  +  tFunc(tObj tMix, tOr3(tFloat,tInt,tObj)), +  tFunc(tMix tObj, tOr3(tFloat,tInt,tObj)),    tFunc(tFloat tInt, tFloat)),    OPT_TRY_OPTIMIZE,0,0);