From 57b26f83051d13442ffa6269230ea9d5803b6d1b Mon Sep 17 00:00:00 2001 From: nagachika Date: Thu, 17 Oct 2013 17:34:22 +0000 Subject: merge revision(s) 43334: [Backport #9030] * vm_insnhelper.c (vm_call_method): set ci->me to 0 when the original method of a refined method is undef to avoid SEGV. * vm_method.c (rb_method_entry_without_refinements): return 0 when the original method of a refined method is undef to avoid SEGV. * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@43345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_method.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'vm_method.c') diff --git a/vm_method.c b/vm_method.c index 41ddb2d1ac..f8cd2d9129 100644 --- a/vm_method.c +++ b/vm_method.c @@ -640,7 +640,12 @@ rb_method_entry_without_refinements(VALUE klass, ID id, } if (defined_class_ptr) *defined_class_ptr = defined_class; - return me; + if (UNDEFINED_METHOD_ENTRY_P(me)) { + return 0; + } + else { + return me; + } } static void -- cgit v1.2.3