summaryrefslogtreecommitdiff
path: root/insns.def
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-11 20:11:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-11 20:11:45 +0000
commit35784d10191308f39f694e8513cfc351d6712865 (patch)
tree160f3efd28297bd264e742852a016db26a75e53d /insns.def
parent2642b69096210193015aee2216f8bea4d4c75d5f (diff)
defined: me in cfp
* insns.def (defined): use method entry and id in cfp for proper superclass, since klass in iseq is shared by dynamically defined methods from the same block. [ruby-core:45831][Bug #6644] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def15
1 files changed, 5 insertions, 10 deletions
diff --git a/insns.def b/insns.def
index ab40d30634..aa5b0eaf9f 100644
--- a/insns.def
+++ b/insns.def
@@ -826,16 +826,11 @@ defined
}
break;
case DEFINED_ZSUPER:{
- rb_iseq_t *iseq = GET_ISEQ();
- while (iseq) {
- if (iseq->defined_method_id) {
- break;
- }
- iseq = iseq->parent_iseq;
- }
- if (iseq) {
- VALUE klass = vm_search_normal_superclass(iseq->klass, GET_SELF());
- if (rb_method_boundp(klass, iseq->defined_method_id, 0)) {
+ const rb_method_entry_t *me = GET_CFP()->me;
+ if (me) {
+ VALUE klass = vm_search_normal_superclass(me->klass, GET_SELF());
+ ID id = me->def ? me->def->original_id : me->called_id;
+ if (rb_method_boundp(klass, id, 0)) {
expr_type = "super";
}
}