diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-25 16:05:17 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-25 16:05:17 +0000 |
commit | ed4e57690c9cc782ab8675c4bf48153ce0a36896 (patch) | |
tree | 5cdf90849da2ef0e17458f17b2d8358929c7a7d2 /vm.c | |
parent | 588e79f7688c9b7f085cb8d46b9289e4769f4135 (diff) | |
download | ruby-ed4e57690c9cc782ab8675c4bf48153ce0a36896.tar.gz |
* insnhelper.ci, vm.c: complete block parameter support.
post arguments, optional arguments, block argument.
* compile.c, parse.y: fix {|a|} parameter.
* insnshelper.ci, insns.def: revert caller_setup_args() option
(need_block_check) parameter.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -539,7 +539,7 @@ invoke_block(rb_thread_t *th, rb_block_t *block, VALUE self, int argc, VALUE *ar VALUE val; if (BUILTIN_TYPE(block->iseq) != T_NODE) { rb_iseq_t *iseq = block->iseq; - int i; + int i, opt_pc; int magic = block_proc_is_lambda(block->proc) ? FRAME_MAGIC_LAMBDA : FRAME_MAGIC_BLOCK; @@ -552,12 +552,13 @@ invoke_block(rb_thread_t *th, rb_block_t *block, VALUE self, int argc, VALUE *ar th->cfp->sp[i] = argv[i]; } - argc = vm_yield_setup_args(th, iseq, argc, th->cfp->sp, magic == FRAME_MAGIC_LAMBDA); + opt_pc = vm_yield_setup_args(th, iseq, argc, th->cfp->sp, magic == FRAME_MAGIC_LAMBDA); + argc = iseq->arg_size; th->cfp->sp += argc; vm_push_frame(th, iseq, magic, self, GC_GUARDED_PTR(block->dfp), - iseq->iseq_encoded, th->cfp->sp, block->lfp, + iseq->iseq_encoded + opt_pc, th->cfp->sp, block->lfp, iseq->local_size - argc); val = vm_eval_body(th); } |