summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--error.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d18e0c0d9b..4b1168320f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Dec 15 23:16:13 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * error.c (builtin_type_name): don't return pointer to the buffer of
+ temporary String object.
+
Thu Dec 15 17:56:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (argf_type): make typed data.
diff --git a/error.c b/error.c
index e3348dc7b5..6844f992a6 100644
--- a/error.c
+++ b/error.c
@@ -392,9 +392,11 @@ builtin_type_name(VALUE x)
else if (SYMBOL_P(x)) {
etype = "Symbol";
}
- else if (rb_special_const_p(x)) {
- x = rb_obj_as_string(x);
- etype = StringValuePtr(x);
+ else if (RB_TYPE_P(x, T_TRUE)) {
+ etype = "true";
+ }
+ else if (RB_TYPE_P(x, T_FALSE)) {
+ etype = "false";
}
else {
etype = rb_obj_classname(x);