summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-09 14:25:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-09 14:25:52 +0000
commit26ae6455014e0155cf37a3a0b77ed7323e15ed39 (patch)
tree4a05786d0cbd9c814b0f6b234bc8825b9c5e3ec0 /vm_insnhelper.c
parentad58f04833b6d9f6b0d01c5fc8adc61df6d088cc (diff)
vm.c: super in bmethod
* vm_eval.c (vm_call_super): allow bound proc method to call super method. * vm_insnhelper.c (vm_yield_with_cfunc): push defined class and bound proc method entry to the control frame. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index d67fd50db5..e442383a04 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1969,7 +1969,8 @@ block_proc_is_lambda(const VALUE procval)
static inline VALUE
vm_yield_with_cfunc(rb_thread_t *th, const rb_block_t *block,
- VALUE self, int argc, const VALUE *argv,
+ VALUE self, VALUE defined_class,
+ int argc, const VALUE *argv,
const rb_block_t *blockargptr)
{
NODE *ifunc = (NODE *) block->iseq;
@@ -1998,9 +1999,10 @@ vm_yield_with_cfunc(rb_thread_t *th, const rb_block_t *block,
blockarg = Qnil;
}
- vm_push_frame(th, (rb_iseq_t *)ifunc, VM_FRAME_MAGIC_IFUNC, self,
- 0, VM_ENVVAL_PREV_EP_PTR(block->ep), 0,
- th->cfp->sp, 1, 0, 0);
+ vm_push_frame(th, (rb_iseq_t *)ifunc, VM_FRAME_MAGIC_IFUNC,
+ self, defined_class,
+ VM_ENVVAL_PREV_EP_PTR(block->ep), 0,
+ th->cfp->sp, 1, th->passed_bmethod_me, 0);
val = (*ifunc->nd_cfnc) (arg, ifunc->nd_tval, argc, argv, blockarg);
@@ -2065,7 +2067,8 @@ vm_invoke_block(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci
else {
VALUE val;
CALLER_SETUP_ARG(th->cfp, ci);
- val = vm_yield_with_cfunc(th, block, block->self, ci->argc, STACK_ADDR_FROM_TOP(ci->argc), 0);
+ val = vm_yield_with_cfunc(th, block, block->self, block->klass,
+ ci->argc, STACK_ADDR_FROM_TOP(ci->argc), 0);
POPN(ci->argc); /* TODO: should put before C/yield? */
return val;
}