diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-05 09:57:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-05 09:57:02 +0000 |
commit | babae0496048b117b0767350e895ca82afaf6849 (patch) | |
tree | 42c3e1c1729903448b5b87052c96c2c5f11398d6 /insns.def | |
parent | 08fbd2cee2f4892d28b925065b3b69b3614d5929 (diff) | |
download | ruby-babae0496048b117b0767350e895ca82afaf6849.tar.gz |
insns.def: refactor by wanabe
* insns.def (defined): use vm_search_superclass() like as normal super
call. based on a patch <https://gist.github.com/wanabe/5520026> by
wanabe.
* vm_insnhelper.c (vm_search_superclass): return error but not raise
exceptions.
* vm_insnhelper.c (vm_search_super_method): check the result of
vm_search_superclass and raise execptions on error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r-- | insns.def | 19 |
1 files changed, 4 insertions, 15 deletions
@@ -764,21 +764,10 @@ defined } break; case DEFINED_ZSUPER:{ - const rb_method_entry_t *me = GET_CFP()->me; - if (!me) { - const rb_control_frame_t *end_cfp = RUBY_VM_END_CONTROL_FRAME(GET_THREAD()); - const rb_control_frame_t *cfp = GET_CFP(); - const VALUE *const local_ep = rb_vm_ep_local_ep(cfp->ep); - while (RUBY_VM_VALID_CONTROL_FRAME_P(cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp), end_cfp)) { - if (cfp->ep == local_ep) { - me = cfp->me; - break; - } - } - } - if (me) { - VALUE klass = vm_search_normal_superclass(GET_CFP()->klass); - ID id = me->def ? me->def->original_id : me->called_id; + rb_call_info_t cit; + if (vm_search_superclass(GET_CFP(), GET_ISEQ(), Qnil, &cit) == 0) { + VALUE klass = cit.klass; + ID id = cit.mid; if (rb_method_boundp(klass, id, 0)) { expr_type = DEFINED_ZSUPER; } |