pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:498:      OPCODE1(F_CLEAR_LOCAL, "clear local", 0, {    free_svalue(Pike_fp->locals + arg1);    SET_SVAL(Pike_fp->locals[arg1], PIKE_T_INT, NUMBER_NUMBER, integer, 0);   });      OPCODE2(F_ADD_LOCALS_AND_POP, "local += local", 0,   {    struct svalue *dst = Pike_fp->locals+arg1;    struct svalue *src = Pike_fp->locals+arg2; -  if( (dst->type|src->type) == PIKE_T_INT +  /* NB: The following test only works because PIKE_T_INT == 0! */ +  if( (TYPEOF(*dst)|TYPEOF(*src)) == PIKE_T_INT    && !INT_TYPE_ADD_OVERFLOW(src->u.integer,dst->u.integer) )    {    SET_SVAL_SUBTYPE(*dst,NUMBER_NUMBER);    dst->u.integer += src->u.integer;    } -  else if( dst->type == src->type && dst->type == PIKE_T_STRING ) +  else if(TYPEOF(*dst) == TYPEOF(*src) && TYPEOF(*dst) == PIKE_T_STRING )    {    struct pike_string *srcs = src->u.string;    struct pike_string *dsts = dst->u.string;    if( dsts->len && srcs->len )    {    size_t tmp = dsts->len;    size_t tmp2 = srcs->len;    /*    * in case srcs==dsts    * pike_string_cpy(MKPCHARP_STR_OFF(dsts,tmp), srcs);
pike.git/src/interpret_functions.h:541:    *Pike_sp++ = *dst;    SET_SVAL_TYPE(*dst,PIKE_T_INT);    push_svalue( src );    f_add(2);    *dst = *--Pike_sp;    }   });      OPCODE2(F_ADD_LOCAL_INT_AND_POP, "local += number", 0,{    struct svalue *dst = Pike_fp->locals+arg1; -  if( dst->type == PIKE_T_INT +  if( TYPEOF(*dst) == PIKE_T_INT    && !INT_TYPE_ADD_OVERFLOW(dst->u.integer,arg2) )    {    SET_SVAL_SUBTYPE(*dst,NUMBER_NUMBER);    dst->u.integer += arg2;    }    else    {    *Pike_sp++ = *dst;    SET_SVAL_TYPE(*dst,PIKE_T_INT);    push_int( arg2 );    f_add(2);    *dst = *--Pike_sp;    }   });      OPCODE2(F_ADD_LOCAL_INT, "local += number local", 0,{    struct svalue *dst = Pike_fp->locals+arg1; -  if( dst->type == PIKE_T_INT +  if( TYPEOF(*dst) == PIKE_T_INT    && !INT_TYPE_ADD_OVERFLOW(dst->u.integer,arg2) )    {    SET_SVAL_SUBTYPE(*dst,NUMBER_NUMBER);    dst->u.integer += arg2;    push_int( dst->u.integer );    }    else    {    *Pike_sp++ = *dst;    SET_SVAL_TYPE(*dst,PIKE_T_INT);