diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-22 14:33:11 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-22 14:33:11 +0000 |
commit | f0f3821be7507a96e613e6d8e7e675eada78a892 (patch) | |
tree | e4a52931045ae0d6a5f6252837eb6fa0054fc1cb /proc.c | |
parent | 86d9d122bef745aad9bf3dabd80ad03fbec1beec (diff) |
merge revision(s) 44175,44179: [Backport #9236]
* proc.c (method_owner): return the class where alias is defined, not
the class original method is defined.
* vm_method.c (rb_method_entry_make, rb_alias): store the originally
defined class in me. [Bug #7993] [Bug #7842] [Bug #9236]
* vm_method.c (rb_method_entry_get_without_cache): cache included
module but not iclass.
* proc.c (mnew_from_me): achieve the original defined_class from
prepended iclass, to fix inherited owner.
* proc.c (method_owner): return the defined class, but not the
class which the method object is created from.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@44345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -991,6 +991,10 @@ mnew(VALUE klass, VALUE obj, ID id, VALUE mclass, int scope) goto again; } + if (RB_TYPE_P(defined_class, T_ICLASS)) { + defined_class = RBASIC(defined_class)->klass; + } + klass = defined_class; while (rclass != klass && @@ -998,10 +1002,6 @@ mnew(VALUE klass, VALUE obj, ID id, VALUE mclass, int scope) rclass = RCLASS_SUPER(rclass); } - if (RB_TYPE_P(klass, T_ICLASS)) { - klass = RBASIC(klass)->klass; - } - gen_method: method = TypedData_Make_Struct(mclass, struct METHOD, &method_data_type, data); @@ -1174,7 +1174,7 @@ method_owner(VALUE obj) struct METHOD *data; TypedData_Get_Struct(obj, struct METHOD, &method_data_type, data); - return data->me->klass; + return data->defined_class; } void |