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_insnhelper.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_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 fc9491f312..8fd6b1ef27 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1903,7 +1903,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; |