summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-06 16:35:45 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-06 16:35:45 +0000
commit968b6238d0bd0ef8e185cd4912587df00ac3c9ef (patch)
treeab60d001dc380bfede651372fa8cdab8980af6aa /proc.c
parentc45b8794365d4950cf71f27de5281327f9e65ba7 (diff)
merge revision(s) 44455,44458,44510: [Backport #9315]
* vm_insnhelper.c (vm_search_super_method): direct superclass of a module is found when super called in a Method object generated a method defined in a module, call method_missing in that case. [ruby-core:59358] [Bug #9315] * 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@44511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/proc.c b/proc.c
index 516007c66d..2f6760315c 100644
--- a/proc.c
+++ b/proc.c
@@ -992,10 +992,6 @@ 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 &&
@@ -1173,9 +1169,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(defined_class)->klass;
+ }
+
+ return defined_class;
}
void