diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-27 04:54:29 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-27 04:54:29 +0000 |
commit | 309ac6447d67fe87d956d01d2491542d6f56818f (patch) | |
tree | 7ecd832f534904e4c03c2d3030474926aa1f2e96 /vm_insnhelper.c | |
parent | 05ebc662fb6e5fc95046714c6c638ffc0016023e (diff) |
merge revision(s) 45564,45565,45584,45585: [Backport #9721]
* proc.c (rb_method_call_with_block, umethod_bind): call with
IClass including the module for a module instance method.
[ruby-core:61936] [Bug #9721]
* vm_insnhelper.c (vm_search_super_method): allow bound
UnboundMethod case.
* proc.c (umethod_bind): use the ancestor iclass instead of new
iclass to get rid of infinite recursion, if the defined module
is already included. [ruby-core:62014] [Bug #9721]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@46157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 253515c63f..b639dd6f96 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -2021,15 +2021,17 @@ vm_search_super_method(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_inf current_defined_class = RCLASS_REFINED_CLASS(current_defined_class); } - if (!FL_TEST(current_defined_class, RMODULE_INCLUDED_INTO_REFINEMENT) && + if (BUILTIN_TYPE(current_defined_class) != T_MODULE && + BUILTIN_TYPE(current_defined_class) != T_ICLASS && /* bound UnboundMethod */ + !FL_TEST(current_defined_class, RMODULE_INCLUDED_INTO_REFINEMENT) && !rb_obj_is_kind_of(ci->recv, current_defined_class)) { VALUE m = RB_TYPE_P(current_defined_class, T_ICLASS) ? RBASIC(current_defined_class)->klass : current_defined_class; rb_raise(rb_eTypeError, "self has wrong type to call super in this context: " - "%s (expected %s)", - rb_obj_classname(ci->recv), rb_class2name(m)); + "%"PRIsVALUE" (expected %"PRIsVALUE")", + rb_obj_class(ci->recv), m); } switch (vm_search_superclass(GET_CFP(), iseq, sigval, ci)) { |