diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-04 02:11:37 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-04 02:11:37 +0000 |
commit | a7e1820a9f9c0b6c84c281c171c105a34aa16738 (patch) | |
tree | 5de8ea761af4e4ac30dc229518093bacc55d2ee2 /vm_insnhelper.c | |
parent | 07132e0675ecacd9215504e9f9631fa1f83b7670 (diff) | |
download | ruby-a7e1820a9f9c0b6c84c281c171c105a34aa16738.tar.gz |
__callee__ fix
* eval.c (rb_frame_callee, rb_f_callee_name): fix to return the called
id.
* vm_insnhelper.c (vm_push_frame): set proper method entry.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 6544ed89fc..22e903ad80 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -30,7 +30,8 @@ vm_push_frame(rb_thread_t *th, VALUE specval, const VALUE *pc, VALUE *sp, - int local_size) + int local_size, + const rb_method_entry_t *me) { rb_control_frame_t *const cfp = th->cfp - 1; int i; @@ -62,7 +63,7 @@ vm_push_frame(rb_thread_t *th, cfp->self = self; cfp->block_iseq = 0; cfp->proc = 0; - cfp->me = 0; + cfp->me = me; if (VMDEBUG == 2) { SDR(); @@ -423,9 +424,8 @@ vm_call_cfunc(rb_thread_t *th, rb_control_frame_t *reg_cfp, EXEC_EVENT_HOOK(th, RUBY_EVENT_C_CALL, recv, me->called_id, me->klass); cfp = vm_push_frame(th, 0, VM_FRAME_MAGIC_CFUNC, recv, - VM_ENVVAL_BLOCK_PTR(blockptr), 0, th->cfp->sp, 1); + VM_ENVVAL_BLOCK_PTR(blockptr), 0, th->cfp->sp, 1, me); - cfp->me = me; reg_cfp->sp -= num + 1; val = call_cfunc(def->body.cfunc.func, recv, (int)def->body.cfunc.argc, num, reg_cfp->sp + 1); @@ -508,7 +508,7 @@ vm_setup_method(rb_thread_t *th, rb_control_frame_t *cfp, vm_push_frame(th, iseq, VM_FRAME_MAGIC_METHOD, recv, VM_ENVVAL_BLOCK_PTR(blockptr), - iseq->iseq_encoded + opt_pc, sp, 0); + iseq->iseq_encoded + opt_pc, sp, 0, me); cfp->sp = rsp - 1 /* recv */; } @@ -531,7 +531,7 @@ vm_setup_method(rb_thread_t *th, rb_control_frame_t *cfp, vm_push_frame(th, iseq, VM_FRAME_MAGIC_METHOD, recv, VM_ENVVAL_BLOCK_PTR(blockptr), - iseq->iseq_encoded + opt_pc, sp, 0); + iseq->iseq_encoded + opt_pc, sp, 0, me); } } @@ -760,7 +760,7 @@ vm_yield_with_cfunc(rb_thread_t *th, const rb_block_t *block, } cfp = vm_push_frame(th, (rb_iseq_t *)ifunc, VM_FRAME_MAGIC_IFUNC, self, - VM_ENVVAL_PREV_EP_PTR(block->ep), 0, th->cfp->sp, 1); + VM_ENVVAL_PREV_EP_PTR(block->ep), 0, th->cfp->sp, 1, 0); if (blockargptr) { VM_CF_LEP(cfp)[0] = VM_ENVVAL_BLOCK_PTR(blockargptr); @@ -980,7 +980,7 @@ vm_invoke_block(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_num_t num, rb_n VM_ENVVAL_PREV_EP_PTR(block->ep), iseq->iseq_encoded + opt_pc, rsp + arg_size, - iseq->local_size - arg_size); + iseq->local_size - arg_size, 0); return Qundef; } |