From 63315f63054890397a19a1cbefe10166cb1768c8 Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 16 Jan 2007 08:43:18 +0000 Subject: [PATCH] * vm.c (invoke_block): fix to specify self. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ vm.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e851f8522d..3d1355cf25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Jan 16 17:39:44 2007 Koichi Sasada + + * vm.c (invoke_block): fix to specify self. + Tue Jan 16 12:12:27 2007 Koichi Sasada * env.h: removed diff --git a/vm.c b/vm.c index f171b559d9..92f4d21f08 100644 --- a/vm.c +++ b/vm.c @@ -663,7 +663,7 @@ th_yield_setup_args(yarv_iseq_t *iseq, int argc, VALUE *argv) } static VALUE -invoke_block(yarv_thread_t *th, yarv_block_t *block, int argc, VALUE *argv, int magic) +invoke_block(yarv_thread_t *th, yarv_block_t *block, VALUE self, int argc, VALUE *argv, int magic) { VALUE val; if (BUILTIN_TYPE(block->iseq) != T_NODE) { @@ -679,7 +679,7 @@ invoke_block(yarv_thread_t *th, yarv_block_t *block, int argc, VALUE *argv, int th->cfp->sp += argc; push_frame(th, iseq, magic, - block->self, GC_GUARDED_PTR(block->dfp), + self, GC_GUARDED_PTR(block->dfp), iseq->iseq_encoded, th->cfp->sp, block->lfp, iseq->local_size - argc); val = th_eval_body(th); @@ -704,7 +704,7 @@ th_invoke_yield(yarv_thread_t *th, int argc, VALUE *argv) th_localjump_error("no block given", Qnil, 0); } - return invoke_block(th, block, argc, argv, FRAME_MAGIC_BLOCK); + return invoke_block(th, block, block->self, argc, argv, FRAME_MAGIC_BLOCK); } VALUE @@ -723,7 +723,7 @@ th_invoke_proc(yarv_thread_t *th, yarv_proc_t *proc, lfp_set_special_cref(proc->block.lfp, proc->special_cref_stack); th->safe_level = proc->safe_level; - val = invoke_block(th, &proc->block, argc, argv, + val = invoke_block(th, &proc->block, self, argc, argv, proc->is_lambda ? FRAME_MAGIC_LAMBDA : FRAME_MAGIC_PROC); } else {