summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-04-11 07:41:32 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-04-11 07:41:32 +0000
commiteaff12d82669f6d55f27b50e559990e7f6b1c108 (patch)
treec41e45abede0850a524f8f76e3891dcf37283f16
parent1c907a93001b65cebfb5229dea11ce60289fd14e (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
-rw-r--r--ChangeLog8
-rw-r--r--class.c13
-rw-r--r--variable.c6
-rw-r--r--version.h4
4 files changed, 19 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index bfaa1f5c02..ed1cbffa0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Wed Apr 11 13:29:26 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * 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".
+
Tue Apr 10 02:24:40 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* io.c (opt_i_set): should strdup() inplace_edit string.
diff --git a/class.c b/class.c
index b76367a77f..b5caf3082a 100644
--- a/class.c
+++ b/class.c
@@ -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;
diff --git a/variable.c b/variable.c
index 445f811a18..6e2ef0c875 100644
--- a/variable.c
+++ b/variable.c
@@ -1084,9 +1084,9 @@ rb_const_get(klass, id)
/* Uninitialized constant */
if (klass && klass != rb_cObject)
- rb_raise(rb_eNameError, "uninitialized constant %s::%s",
- RSTRING(rb_class_path(klass))->ptr,
- rb_id2name(id));
+ rb_raise(rb_eNameError, "uninitialized constant %s at %s",
+ rb_id2name(id),
+ RSTRING(rb_class_path(klass))->ptr);
else {
rb_raise(rb_eNameError, "uninitialized constant %s",rb_id2name(id));
}
diff --git a/version.h b/version.h
index 4b32460ba7..bed4533f35 100644
--- a/version.h
+++ b/version.h
@@ -1,4 +1,4 @@
#define RUBY_VERSION "1.6.4"
-#define RUBY_RELEASE_DATE "2001-04-10"
+#define RUBY_RELEASE_DATE "2001-04-11"
#define RUBY_VERSION_CODE 164
-#define RUBY_RELEASE_CODE 20010410
+#define RUBY_RELEASE_CODE 20010411