summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-05 05:18:48 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-05 05:18:48 +0000
commit89d6841175f4e3a853c1dfc5c03ee9314fe984c4 (patch)
tree2097c8f0949e5a77bd96ef8e5e119ff7a008c942 /error.c
parent68f8df9e15a3348d472ba58ff38fd497ae94d3a8 (diff)
Error#to_s should ensure that the value returned is a string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r--error.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/error.c b/error.c
index ab252a6d6b..b58f0f76d5 100644
--- a/error.c
+++ b/error.c
@@ -524,8 +524,7 @@ exc_to_s(VALUE exc)
VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
- OBJ_INFECT(mesg, exc);
- return mesg;
+ return rb_String(mesg);
}
/*