pike.git / src / operators.c

version» Context lines:

pike.git/src/operators.c:1472:    Note: these cases mainly tend to happen when there is an object    in the argument list. otherwise pairwise addition is not done    using this code.    */    case PIKE_T_INT:    {    INT_TYPE res;    if (DO_INT_TYPE_ADD_OVERFLOW(Pike_sp[-2].u.integer, Pike_sp[-1].u.integer, &res))    {    convert_svalue_to_bignum(Pike_sp-2); -  call_lfun(LFUN_ADD,LFUN_RADD); +  if (LIKELY(call_lfun(LFUN_ADD,LFUN_RADD))) {    return 1;    } -  +  Pike_fatal("Failed to call `+() in bignum.\n"); +  }    Pike_sp[-2].u.integer = res;    Pike_sp--;    }    return 1;    case PIKE_T_FLOAT:    Pike_sp[-2].u.float_number += Pike_sp[-1].u.float_number;    Pike_sp--;    return 1;    case PIKE_T_STRING:    Pike_sp[-2].u.string = add_and_free_shared_strings(Pike_sp[-2].u.string,
pike.git/src/operators.c:2264:       case T_FLOAT:    Pike_sp--;    Pike_sp[-1].u.float_number -= Pike_sp[0].u.float_number;    return;       case T_INT:    if(INT_TYPE_SUB_OVERFLOW(Pike_sp[-2].u.integer, Pike_sp[-1].u.integer))    {    convert_stack_top_to_bignum(); -  call_lfun(LFUN_SUBTRACT, LFUN_RSUBTRACT); +  if (LIKELY(call_lfun(LFUN_SUBTRACT, LFUN_RSUBTRACT))) {    return;    } -  +  Pike_fatal("Failed to call `-() in bignum.\n"); +  }    Pike_sp--;    SET_SVAL(Pike_sp[-1], PIKE_T_INT, NUMBER_NUMBER, integer,    Pike_sp[-1].u.integer - Pike_sp[0].u.integer);    return;       case T_STRING:    {    struct pike_string *s,*ret;    s=make_shared_string("");    ret=string_replace(Pike_sp[-2].u.string,Pike_sp[-1].u.string,s);
pike.git/src/operators.c:4032:    INT_TYPE tmp;       if (Pike_sp[-1].u.integer == 0)    OP_DIVISION_BY_ZERO_ERROR("`/");       if(INT_TYPE_DIV_OVERFLOW(Pike_sp[-2].u.integer, Pike_sp[-1].u.integer))    {    stack_swap();    convert_stack_top_to_bignum();    stack_swap(); -  call_lfun(LFUN_DIVIDE,LFUN_RDIVIDE); +  if (LIKELY(call_lfun(LFUN_DIVIDE,LFUN_RDIVIDE))) {    return;    } -  +  Pike_fatal("Failed to call `/() in bignum.\n"); +  }    else    tmp = Pike_sp[-2].u.integer/Pike_sp[-1].u.integer;    Pike_sp--;       /* What is this trying to solve? /Noring */    /* It fixes rounding towards negative infinity. /mast */    if((Pike_sp[-1].u.integer<0) != (Pike_sp[0].u.integer<0))    if(tmp*Pike_sp[0].u.integer!=Pike_sp[-1].u.integer)    tmp--;    SET_SVAL(Pike_sp[-1], T_INT, NUMBER_NUMBER, integer, tmp);