aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-29 12:42:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-29 12:42:42 +0000
commitfd7ee4552cdd8c121f6bc6364fdd0e764ae35520 (patch)
tree8b10337a18e345187a1bbaf26c200d86d5b197fb /vm_insnhelper.c
parent0b3698ee056c91a6ced2f90c729b5e7d3a617dfd (diff)
downloadruby-fd7ee4552cdd8c121f6bc6364fdd0e764ae35520.tar.gz
visibility of inherited method
* vm_insnhelper.c (vm_call_method_each_type): honor the original visibility of inherited methods when a refinement is defined but not activated. [ruby-core:82209] [Bug #13776] Author: Mon_Ouie (Mon ouïe) <mon.ouie@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 856178d5d0..d835997f7c 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -2283,11 +2283,12 @@ vm_call_method_each_type(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_cal
no_refinement_dispatch:
if (cc->me->def->body.refined.orig_me) {
cc->me = refined_method_callable_without_refinement(cc->me);
- return vm_call_method(th, cfp, calling, ci, cc);
}
else {
- return vm_call_zsuper(th, cfp, calling, ci, cc, cc->me->owner);
+ VALUE klass = RCLASS_SUPER(cc->me->owner);
+ cc->me = klass ? rb_callable_method_entry(klass, ci->mid) : NULL;
}
+ return vm_call_method(th, cfp, calling, ci, cc);
}
}