summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-27 16:03:12 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-27 16:03:12 +0000
commit69eab6991a64b6dff4209f96d719680a875b0d89 (patch)
tree118d9f1770ef9d22f0af8f4a1437c96580e15a2e /vm_insnhelper.c
parent41fd33e5fe22f13fd178c50adaee39ce53a3c155 (diff)
merge revision(s) r45179,r45564,r45565,r45584,r45585: [Backport #9721]
envutil.rb: move labeled_module and labeled_class * test/ruby/envutil.rb (labeled_module, labeled_class): move from test/ruby/test_module.rb. * 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_1@46190 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 55c0515425..8c7071a91e 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -2002,6 +2002,7 @@ vm_search_super_method(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_inf
}
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) ?
@@ -2009,8 +2010,8 @@ vm_search_super_method(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_inf
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)) {