pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:1017:    ; /* make gcc happy */   });      OPCODE1(F_GLOBAL_LVALUE, "& global", I_UPDATE_SP, {    ref_push_object(Pike_fp->current_object);    push_obj_index(arg1 + Pike_fp->context->identifier_level);   });      OPCODE0(F_INC, "++x", I_UPDATE_SP, {    union anything *u=get_pointer_if_this_type(Pike_sp-2, PIKE_T_INT); -  if(u && !INT_TYPE_ADD_OVERFLOW(u->integer, 1)) +  /* NOTE: if u->integer is 0, the lvalue could be UNDEFINED. +  * we use the slow path to make sure it becomes a proper integer */ +  if(u && u->integer && !INT_TYPE_ADD_OVERFLOW(u->integer, 1))    {    INT_TYPE val = ++u->integer;    pop_2_elems();    push_int(val);    } else {    lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++;    push_int(1);    f_add(2);    assign_lvalue(Pike_sp-3, Pike_sp-1);    stack_pop_2_elems_keep_top();    }   });      OPCODE0(F_DEC, "--x", I_UPDATE_SP, {    union anything *u=get_pointer_if_this_type(Pike_sp-2, PIKE_T_INT); -  if(u && !INT_TYPE_SUB_OVERFLOW(u->integer, 1)) +  /* NOTE: if u->integer is 0, the lvalue could be UNDEFINED. +  * we use the slow path to make sure it becomes a proper integer */ +  if(u && u->integer && !INT_TYPE_SUB_OVERFLOW(u->integer, 1))    {    INT_TYPE val = --u->integer;    pop_2_elems();    push_int(val);    } else {    lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++;    push_int(1);    o_subtract();    assign_lvalue(Pike_sp-3, Pike_sp-1);    stack_pop_2_elems_keep_top();    }   });      OPCODE0(F_DEC_AND_POP, "x-- and pop", I_UPDATE_SP, {    union anything *u=get_pointer_if_this_type(Pike_sp-2, PIKE_T_INT); -  if(u && !INT_TYPE_SUB_OVERFLOW(u->integer, 1)) +  /* NOTE: if u->integer is 0, the lvalue could be UNDEFINED. +  * we use the slow path to make sure it becomes a proper integer */ +  if(u && u->integer && !INT_TYPE_SUB_OVERFLOW(u->integer, 1))    {    --u->integer;    pop_2_elems();    }else{    lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++;    push_int(1);    o_subtract();    assign_lvalue(Pike_sp-3, Pike_sp-1);    pop_n_elems(3);    }   });      OPCODE0(F_INC_AND_POP, "x++ and pop", I_UPDATE_SP, {    union anything *u=get_pointer_if_this_type(Pike_sp-2, PIKE_T_INT); -  if(u && !INT_TYPE_ADD_OVERFLOW(u->integer, 1)) +  /* NOTE: if u->integer is 0, the lvalue could be UNDEFINED. +  * we use the slow path to make sure it becomes a proper integer */ +  if(u && u->integer && !INT_TYPE_ADD_OVERFLOW(u->integer, 1))    {    ++u->integer;    pop_2_elems();    } else {    lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++;    push_int(1);    f_add(2);    assign_lvalue(Pike_sp-3, Pike_sp-1);    pop_n_elems(3);    }   });      OPCODE0(F_POST_INC, "x++", I_UPDATE_SP, {    union anything *u=get_pointer_if_this_type(Pike_sp-2, PIKE_T_INT); -  if(u && !INT_TYPE_ADD_OVERFLOW(u->integer, 1)) +  /* NOTE: if u->integer is 0, the lvalue could be UNDEFINED. +  * we use the slow path to make sure it becomes a proper integer */ +  if(u && u->integer && !INT_TYPE_ADD_OVERFLOW(u->integer, 1))    {    INT_TYPE val = u->integer++;    pop_2_elems();    push_int(val);    } else {    lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++;    stack_dup();    push_int(1);    f_add(2);    assign_lvalue(Pike_sp-4, Pike_sp-1);    pop_stack();    stack_pop_2_elems_keep_top();    print_return_value();    }   });      OPCODE0(F_POST_DEC, "x--", I_UPDATE_SP, {    union anything *u=get_pointer_if_this_type(Pike_sp-2, PIKE_T_INT); -  if(u && !INT_TYPE_SUB_OVERFLOW(u->integer, 1)) +  /* NOTE: if u->integer is 0, the lvalue could be UNDEFINED. +  * we use the slow path to make sure it becomes a proper integer */ +  if(u && u->integer && !INT_TYPE_SUB_OVERFLOW(u->integer, 1))    {    INT_TYPE val = u->integer--;    pop_2_elems();    push_int(val);    } else {    lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++;    stack_dup();    push_int(1);    o_subtract();    assign_lvalue(Pike_sp-4, Pike_sp-1);