diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-06-16 07:04:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-06-16 07:04:48 +0000 |
commit | 3e0723af69a5c6ea00c7d97a7965199903dddd77 (patch) | |
tree | 8918a7eb81fba2a25f009837d5f765b3cdae6397 | |
parent | 35ec0ad3f34424267a9193a472f093a648b451a3 (diff) |
* object.c (rb_mod_le): singleton class inherits Class rather than its
object's class. [ruby-dev:23690]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | object.c | 5 |
2 files changed, 10 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Wed Jun 16 16:04:40 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * object.c (rb_mod_le): 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. @@ -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; |