summaryrefslogtreecommitdiffstats
path: root/object.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-16 07:04:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-16 07:04:05 +0000
commitd04383aa62a2396f55d964214f50940be24ec6f4 (patch)
treea4fcd636d6f57486eb5b08280dd4a3e9df10cd0d /object.c
parent1e2e1b11a11b915e7b3c8b9a6ec896c95166a5b9 (diff)
downloadruby-d04383aa62a2396f55d964214f50940be24ec6f4.tar.gz
ruby-d04383aa62a2396f55d964214f50940be24ec6f4.tar.xz
ruby-d04383aa62a2396f55d964214f50940be24ec6f4.zip
* object.c (rb_class_inherited_p): singleton class inherits Class
rather than its object's class. [ruby-dev:23690] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/object.c b/object.c
index 2fb2bd063..f2c8c5f52 100644
--- a/object.c
+++ b/object.c
@@ -1257,6 +1257,11 @@ rb_class_inherited_p(mod, arg)
rb_raise(rb_eTypeError, "compared with non class/module");
}
+ if (FL_TEST(mod, FL_SINGLETON)) {
+ if (RCLASS(mod)->m_tbl == RCLASS(arg)->m_tbl)
+ return Qtrue;
+ mod = RBASIC(mod)->klass;
+ }
while (mod) {
if (RCLASS(mod)->m_tbl == RCLASS(arg)->m_tbl)
return Qtrue;