summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-02 14:23:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-02 14:23:56 +0000
commita58c224dcff50eec3149df0f91b8a0f2e8099db6 (patch)
tree298c5c58a37d3eaa82cd1a77458721b4b6b93e52 /object.c
parent908e70185162e31fc716a8ff7895f221f70ff97c (diff)
downloadruby-a58c224dcff50eec3149df0f91b8a0f2e8099db6.tar.gz
object.c: skip prepending modules
* object.c (rb_obj_is_kind_of): skip prepending modules. [ruby-core:54742] [Bug #8357] * object.c (rb_class_inherited_p): ditto. [ruby-core:54736] [Bug #8357] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/object.c b/object.c
index b22d8b6412..f1ab33cd2e 100644
--- a/object.c
+++ b/object.c
@@ -599,6 +599,7 @@ rb_obj_is_kind_of(VALUE obj, VALUE c)
VALUE cl = CLASS_OF(obj);
c = class_or_module_required(c);
+ c = RCLASS_ORIGIN(c);
while (cl) {
if (cl == c || RCLASS_M_TBL(cl) == RCLASS_M_TBL(c))
return Qtrue;
@@ -1511,6 +1512,7 @@ rb_class_inherited_p(VALUE mod, VALUE arg)
if (!CLASS_OR_MODULE_P(arg)) {
rb_raise(rb_eTypeError, "compared with non class/module");
}
+ arg = RCLASS_ORIGIN(arg);
while (mod) {
if (RCLASS_M_TBL(mod) == RCLASS_M_TBL(arg))
return Qtrue;