diff options
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 6214d35ab9..d6029ea6ec 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -2299,7 +2299,10 @@ vm_call_method_each_type(rb_execution_context_t *ec, rb_control_frame_t *cfp, st goto no_refinement_dispatch; } } - cc->me = ref_me; + if (cc->me->def->type != VM_METHOD_TYPE_REFINED || + cc->me->def != ref_me->def) { + cc->me = ref_me; + } if (ref_me->def->type != VM_METHOD_TYPE_REFINED) { return vm_call_method(ec, cfp, calling, ci, cc); } |