summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-08 13:53:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-08 13:53:18 +0000
commit5c0d17c9a2fbbb60e24cd6bd41ffdf8b63b07318 (patch)
tree679385a31a6805ce4f33e6299c023c52ea41a86c /vm_insnhelper.c
parentfe46b2d5f05057dd2d238d71fc2276406d259cef (diff)
vm_insnhelper.c: revive r44455 for bound module method
* vm_insnhelper.c (vm_search_super_method): when super called in a bound UnboundMethod generated from a module, no superclass is found since the current defined class is the module, then call method_missing in that case. [ruby-core:59619] [Bug #9377] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index c8cbaa07bf..eb3ba37623 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -2024,6 +2024,12 @@ vm_search_super_method(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_inf
" by define_method() is not supported."
" Specify all arguments explicitly.");
}
+ if (!ci->klass) {
+ /* bound instance method of module */
+ ci->aux.missing_reason = NOEX_SUPER;
+ CI_SET_FASTPATH(ci, vm_call_method_missing, 1);
+ return;
+ }
/* TODO: use inline cache */
ci->me = rb_method_entry(ci->klass, ci->mid, &ci->defined_class);