diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-29 03:11:17 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-29 03:11:17 +0000 |
commit | a69f01fa52e3ab47fa700442251f73f47846bb9f (patch) | |
tree | 21edfbc648546117d533a5c0eb1aebaab98964ab /proc.c | |
parent | cb08e708227216bd2810a6bda18140467d23cb34 (diff) | |
download | ruby-a69f01fa52e3ab47fa700442251f73f47846bb9f.tar.gz |
proc.c: fix inherited method owner
* proc.c (mnew_from_me): keep iclass as-is, to make inheritance
chain consistent. [ruby-core:59358] [Bug #9315]
* proc.c (method_owner): return the original defined_class from
prepended iclass, instead.
* vm_insnhelper.c (vm_search_super_method): revert r44455, no
longer defined_class becomes a module.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1224,10 +1224,6 @@ mnew_from_me(rb_method_entry_t *me, VALUE defined_class, VALUE klass, goto again; } - if (RB_TYPE_P(defined_class, T_ICLASS)) { - defined_class = RBASIC_CLASS(defined_class); - } - klass = defined_class; while (rclass != klass && @@ -1449,9 +1445,16 @@ static VALUE method_owner(VALUE obj) { struct METHOD *data; + VALUE defined_class; TypedData_Get_Struct(obj, struct METHOD, &method_data_type, data); - return data->defined_class; + defined_class = data->defined_class; + + if (RB_TYPE_P(defined_class, T_ICLASS)) { + defined_class = RBASIC_CLASS(defined_class); + } + + return defined_class; } void |