diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-17 17:34:22 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-17 17:34:22 +0000 |
commit | 57b26f83051d13442ffa6269230ea9d5803b6d1b (patch) | |
tree | 0180d96b1f83f420f5155275ecce133dcd606752 /vm_method.c | |
parent | 4c9a4c333102faf6b905e26300151c81780411a2 (diff) |
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
Diffstat (limited to 'vm_method.c')
-rw-r--r-- | vm_method.c | 7 |
1 files changed, 6 insertions, 1 deletions
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 |