summaryrefslogtreecommitdiffstats
path: root/object.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-16 07:04:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-16 07:04:48 +0000
commit34c9f5779ab00fc46f8b458101f928dccf9fd4f7 (patch)
tree8918a7eb81fba2a25f009837d5f765b3cdae6397 /object.c
parent3259145c33c7e44e207f57c5101460ddaf79b47a (diff)
downloadruby-34c9f5779ab00fc46f8b458101f928dccf9fd4f7.tar.gz
ruby-34c9f5779ab00fc46f8b458101f928dccf9fd4f7.tar.xz
ruby-34c9f5779ab00fc46f8b458101f928dccf9fd4f7.zip
* object.c (rb_mod_le): singleton class inherits Class rather than its
object's class. [ruby-dev:23690] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6463 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 b44534fc0..dd6b1f3ae 100644
--- a/object.c
+++ b/object.c
@@ -1283,6 +1283,11 @@ rb_mod_le(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;