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_insnhelper.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_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 9d321c0529..691f4d1030 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1840,7 +1840,13 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci) no_refinement_dispatch: if (ci->me->def->body.orig_me) { ci->me = ci->me->def->body.orig_me; - goto normal_method_dispatch; + if (UNDEFINED_METHOD_ENTRY_P(ci->me)) { + ci->me = 0; + goto start_method_dispatch; + } + else { + goto normal_method_dispatch; + } } else { klass = ci->me->klass; |