aboutsummaryrefslogtreecommitdiffstats
path: root/vm_method.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-17 08:44:26 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-17 08:44:26 +0000
commitf8e0e1647eb80d2b6e84b1ecceaaf86649719a96 (patch)
treefbb9a6a0dfeb1fc6cd894d6c3eb306489ebb494a /vm_method.c
parent76b06555d05bbf320e2014762efd310de11f0068 (diff)
downloadruby-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.c7
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