diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-04-11 07:41:32 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-04-11 07:41:32 +0000 |
commit | eaff12d82669f6d55f27b50e559990e7f6b1c108 (patch) | |
tree | c41e45abede0850a524f8f76e3891dcf37283f16 /class.c | |
parent | 1c907a93001b65cebfb5229dea11ce60289fd14e (diff) |
* class.c (rb_singleton_class_attached): should modify iv_tbl by
itself, no longer use rb_iv_set() to avoid freeze check error.
* variable.c (rb_const_get): error message "uninitialized constant
Foo at Bar::Baz" instead of "uninitialized constantBar::Baz::Foo".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -112,8 +112,12 @@ void rb_singleton_class_attached(klass, obj) VALUE klass, obj; { - if (FL_TEST(klass, FL_SINGLETON)) - rb_iv_set(klass, "__attached__", obj); + if (FL_TEST(klass, FL_SINGLETON)) { + if (!RCLASS(klass)->iv_tbl) { + RCLASS(klass)->iv_tbl = st_init_numtable(); + } + st_insert(RCLASS(klass)->iv_tbl, rb_intern("__attached__"), obj); + } } VALUE @@ -257,11 +261,6 @@ rb_include_module(klass, module) if (!OBJ_TAINTED(klass)) { rb_secure(4); } - - rb_frozen_class_p(klass); - if (!OBJ_TAINTED(klass)) { - rb_secure(4); - } if (NIL_P(module)) return; if (klass == module) return; |