diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | insnhelper.h | 5 | ||||
-rw-r--r-- | insns.def | 4 |
3 files changed, 11 insertions, 4 deletions
@@ -1,3 +1,9 @@ +Wed Jun 6 02:40:20 2007 NAKAMURA Usaku <usa@ruby-lang.org> + + * insnhelper.h, insns.def (DEC_SP): shoudn't use unary minus operator + in pointer operation. some compilers (such as VC++8 x64) cannot deal + it with expected way. + Wed Jun 6 02:19:48 2007 Koichi Sasada <ko1@atdot.net> * parse.y (new_yield), compile.c (iseq_compile_each): fix diff --git a/insnhelper.h b/insnhelper.h index 1c13dd4df2..eb6b3ef21b 100644 --- a/insnhelper.h +++ b/insnhelper.h @@ -25,8 +25,8 @@ #define PUSH(x) (SET_SV(x), INC_SP(1)) #define TOPN(n) (*(GET_SP()-(n)-1)) -#define POPN(n) (INC_SP(-(n))) -#define POP() (INC_SP(-1)) +#define POPN(n) (DEC_SP(n)) +#define POP() (DEC_SP(1)) #define STACK_ADDR_FROM_TOP(n) (GET_SP()-(n)) #define GET_TOS() (tos) /* dummy */ @@ -84,6 +84,7 @@ #define GET_SP() (USAGE_ANALYSIS_REGISTER_HELPER(1, 0, REG_SP)) #define SET_SP(x) (REG_SP = (USAGE_ANALYSIS_REGISTER_HELPER(1, 1, (x)))) #define INC_SP(x) (REG_SP += (USAGE_ANALYSIS_REGISTER_HELPER(1, 1, (x)))) +#define DEC_SP(x) (REG_SP -= (USAGE_ANALYSIS_REGISTER_HELPER(1, 1, (x)))) #define SET_SV(x) (*GET_SP() = (x)) /* set current stack value as x */ @@ -1190,7 +1190,7 @@ send mn = rb_method_node(klass, id); num -= 1; - INC_SP(-1); + DEC_SP(1); } if (node->nd_cfnc == rb_f_funcall) { @@ -1344,7 +1344,7 @@ invokeblock } } - INC_SP(-argc); + DEC_SP(argc); argc = th_yield_setup_args(th, iseq, argc, GET_SP(), block_proc_is_lambda(block->proc)); INC_SP(argc); |