diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-01 18:59:06 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-01 18:59:06 +0000 |
commit | 62586a95d39a92d7c96b711919955b72c8ac5ecf (patch) | |
tree | 5ebd92414a2a91f4282b387499fe3d7c4039a934 /vm.c | |
parent | a11bb4fa91f520847afcdc6e56b44a904564f4d9 (diff) |
merge revision(s) 55462: [Backport #11954]
* vm.c (invoke_bmethod, invoke_block_from_c_0): revert r52104
partially to avoid "self has wrong type to call super in this
context" errors.
[ruby-core:72724] [Bug #11954]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -922,15 +922,12 @@ invoke_block(rb_thread_t *th, const rb_iseq_t *iseq, VALUE self, const rb_block_ } static VALUE -invoke_bmethod(rb_thread_t *th, const rb_iseq_t *iseq, VALUE self, const rb_block_t *block, int type, int opt_pc) +invoke_bmethod(rb_thread_t *th, const rb_iseq_t *iseq, VALUE self, const rb_block_t *block, const rb_callable_method_entry_t *me, int type, int opt_pc) { /* bmethod */ int arg_size = iseq->body->param.size; - const rb_callable_method_entry_t *me = th->passed_bmethod_me; VALUE ret; - th->passed_bmethod_me = NULL; - vm_push_frame(th, iseq, type | VM_FRAME_FLAG_FINISH | VM_FRAME_FLAG_BMETHOD, self, VM_ENVVAL_PREV_EP_PTR(block->ep), (VALUE)me, /* cref or method (TODO: can we ignore cref?) */ @@ -959,6 +956,9 @@ invoke_block_from_c_0(rb_thread_t *th, const rb_block_t *block, int i, opt_pc; int type = block_proc_is_lambda(block->proc) ? VM_FRAME_MAGIC_LAMBDA : VM_FRAME_MAGIC_BLOCK; VALUE *sp = th->cfp->sp; + const rb_callable_method_entry_t *me = th->passed_bmethod_me; + + th->passed_bmethod_me = NULL; for (i=0; i<argc; i++) { sp[i] = argv[i]; @@ -967,11 +967,11 @@ invoke_block_from_c_0(rb_thread_t *th, const rb_block_t *block, opt_pc = vm_yield_setup_args(th, iseq, argc, sp, blockptr, (type == VM_FRAME_MAGIC_LAMBDA ? (splattable ? arg_setup_lambda : arg_setup_method) : arg_setup_block)); - if (th->passed_bmethod_me == NULL) { + if (me == NULL) { return invoke_block(th, iseq, self, block, cref, type, opt_pc); } else { - return invoke_bmethod(th, iseq, self, block, type, opt_pc); + return invoke_bmethod(th, iseq, self, block, me, type, opt_pc); } } |