summaryrefslogtreecommitdiff
path: root/insns.def
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-05 07:29:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-05 07:29:44 +0000
commit08fbd2cee2f4892d28b925065b3b69b3614d5929 (patch)
tree6a2a2ddc7a85e57364fe436b4ec5b4c4a913b0e9 /insns.def
parent13bd7afc6eddcba1df765ac6c63981f6d203fd43 (diff)
insns.def: method entry from method frame
* insns.def (defined): get method entry from the method top level frame, not block frame. [ruby-core:54769] [Bug #8367] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def11
1 files changed, 11 insertions, 0 deletions
diff --git a/insns.def b/insns.def
index b51e60018c..d8be61114e 100644
--- a/insns.def
+++ b/insns.def
@@ -765,6 +765,17 @@ 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;