From 2faf2957bf64cf5cd4cbe0da67efb7c70f54c645 Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 25 Jan 2008 18:02:01 +0000 Subject: * compile.c, compile.h: fix stack pointer issues. calculate correct stack depth at compile time. * insns.def (emptstack): remove it and add a new insn "adjuststack". * bootstraptest/test_knownbug.rb: move/remove fixed test. * bootstraptest/test_syntax.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- insns.def | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'insns.def') diff --git a/insns.def b/insns.def index e9b72b7dc..ec8ffa77e 100644 --- a/insns.def +++ b/insns.def @@ -695,12 +695,12 @@ setn @j current stack を空にする。 */ DEFINE_INSN -emptstack -() +adjuststack +(rb_num_t n) (...) -(...) // inc = 0; depth = 0; +(...) // inc -= n { - SET_SP(GET_CFP()->bp); + INC_SP(-n); } @@ -1060,7 +1060,7 @@ DEFINE_INSN invokesuper (rb_num_t op_argc, ISEQ blockiseq, rb_num_t op_flag) (...) -(VALUE val) // inc += - op_argc; +(VALUE val) // inc += - (op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0)); { rb_block_t *blockptr = !(op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? GET_BLOCK_PTR() : 0; int num = caller_setup_args(th, GET_CFP(), op_flag, op_argc, blockiseq, &blockptr); -- cgit