aboutsummaryrefslogtreecommitdiffstats
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
commit6a5e63a71557428a68a576a0890e784a6dd12a25 (patch)
treea4fcd636d6f57486eb5b08280dd4a3e9df10cd0d
parent83c917df38d6edbcbe7a220d21ed2e8d3a97b1d6 (diff)
downloadruby-6a5e63a71557428a68a576a0890e784a6dd12a25.tar.gz
* object.c (rb_class_inherited_p): singleton class inherits Class
rather than its object's class. [ruby-dev:23690] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--object.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 10bfe629eb..123c8b61c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jun 16 16:03:59 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * object.c (rb_class_inherited_p): singleton class inherits Class
+ rather than its object's class. [ruby-dev:23690]
+
Wed Jun 16 16:01:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (stack_grow_direction): memoize the direction.
diff --git a/object.c b/object.c
index 2fb2bd0638..f2c8c5f522 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;