From a58c224dcff50eec3149df0f91b8a0f2e8099db6 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 2 May 2013 14:23:56 +0000 Subject: 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 --- object.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'object.c') 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; -- cgit v1.2.3