pike.git / src / operators.c

version» Context lines:

pike.git/src/operators.c:375:    return;       case T_INT:    sp--;    sp[-1].u.integer -= sp[0].u.integer;    return;       case T_STRING:    {    struct lpc_string *s,*ret; -  sp--; +     s=make_shared_string(""); -  ret=string_replace(sp[-1].u.string,sp[0].u.string,s); +  ret=string_replace(sp[-2].u.string,sp[-1].u.string,s); +  free_string(sp[-2].u.string);    free_string(sp[-1].u.string); -  free_string(sp[0].u.string); +     free_string(s); -  sp[-1].u.string=ret; +  sp[-2].u.string=ret; +  sp--;    return;    }       default:    error("Bad argument 1 to subtraction.\n");    }   }      void f_minus(INT32 args)   {
pike.git/src/operators.c:697:         #define TWO_TYPES(X,Y) (((X)<<8)|(Y))   void o_multiply()   {    switch(TWO_TYPES(sp[-2].type,sp[-1].type))    {    case TWO_TYPES(T_ARRAY,T_STRING):    {    struct lpc_string *ret; +  ret=implode(sp[-2].u.array,sp[-1].u.string); +  free_string(sp[-1].u.string); +  free_array(sp[-2].u.array); +  sp[-2].type=T_STRING; +  sp[-2].u.string=ret;    sp--; -  ret=implode(sp[-1].u.array,sp[0].u.string); -  free_string(sp[0].u.string); -  free_array(sp[-1].u.array); -  sp[-1].type=T_STRING; -  sp[-1].u.string=ret; +     return;    }       case TWO_TYPES(T_FLOAT,T_FLOAT):    sp--;    sp[-1].u.float_number *= sp[0].u.float_number;    return;       case TWO_TYPES(T_FLOAT,T_INT):    sp--;
pike.git/src/operators.c:772:   void o_divide()   {    if(sp[-2].type!=sp[-1].type && !float_promote())    error("Division on different types.\n");       switch(sp[-2].type)    {    case T_STRING:    {    struct array *ret; -  sp--; -  ret=explode(sp[-1].u.string,sp[0].u.string); +  ret=explode(sp[-2].u.string,sp[-1].u.string); +  free_string(sp[-2].u.string);    free_string(sp[-1].u.string); -  free_string(sp[0].u.string); -  sp[-1].type=T_ARRAY; -  sp[-1].u.array=ret; +  sp[-2].type=T_ARRAY; +  sp[-2].u.array=ret; +  sp--;    return;    }       case T_FLOAT:    if(sp[-1].u.float_number == 0.0)    error("Division by zero.\n");    sp--;    sp[-1].u.float_number /= sp[0].u.float_number;    return;