diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-17 08:44:26 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-17 08:44:26 +0000 |
commit | f8e0e1647eb80d2b6e84b1ecceaaf86649719a96 (patch) | |
tree | fbb9a6a0dfeb1fc6cd894d6c3eb306489ebb494a /vm_method.c | |
parent | 76b06555d05bbf320e2014762efd310de11f0068 (diff) | |
download | ruby-f8e0e1647eb80d2b6e84b1ecceaaf86649719a96.tar.gz |
* 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/trunk@43334 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 0066c17c8a..30bd6b6a1f 100644 --- a/vm_method.c +++ b/vm_method.c @@ -670,7 +670,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 |