summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-21 12:27:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-21 12:27:21 +0000
commitf96ab4131c9542dfe2696e7209a803e3d2eccc63 (patch)
treed67a04ecf95a870ac3011b6e0e407dcfd3a1446f
parente8ab40d239baa5a473e81731c828f2c75dfcb06d (diff)
* object.c (rb_to_id): use rb_str_intern() instead of rb_intern()
directly, for sanity check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--object.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1ca0936c5f..26efe7edd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jun 21 21:27:18 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
+
+ * object.c (rb_to_id): use rb_str_intern() instead of rb_intern()
+ directly, for sanity check.
+
Sat Jun 21 13:56:09 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
* wince/Makefile.sub: undefine HAVE__SETJMP.
diff --git a/object.c b/object.c
index a559f12f1d..1e7c5c1d45 100644
--- a/object.c
+++ b/object.c
@@ -788,7 +788,7 @@ rb_to_id(name)
switch (TYPE(name)) {
case T_STRING:
- return rb_intern(RSTRING(name)->ptr);
+ return rb_str_intern(name);
case T_FIXNUM:
rb_warn("do not use Fixnums as Symbols");
id = FIX2LONG(name);
@@ -802,7 +802,7 @@ rb_to_id(name)
default:
tmp = rb_check_string_type(name);
if (!NIL_P(tmp)) {
- return rb_intern(RSTRING(tmp)->ptr);
+ return rb_str_intern(tmp);
}
rb_raise(rb_eTypeError, "%s is not a symbol", RSTRING(rb_inspect(name))->ptr);
}