summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--eval_error.c6
2 files changed, 7 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 5f2fb11..2876586 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-Mon Jun 10 15:35:34 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Jun 10 15:36:00 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval_error.c (error_print): use checking functions instead of
+ catching exceptions.
* eval_error.c (error_print): restore errinfo for the case new
excecption raised while printing the message. [ruby-core:55365]
diff --git a/eval_error.c b/eval_error.c
index fad8c22..aa9d10f 100644
--- a/eval_error.c
+++ b/eval_error.c
@@ -127,9 +127,9 @@ error_print(void)
}
eclass = CLASS_OF(errinfo);
- if (eclass != Qundef) {
- e = rb_funcall(errinfo, rb_intern("message"), 0, 0);
- StringValue(e);
+ if (eclass != Qundef &&
+ (e = rb_check_funcall(errinfo, rb_intern("message"), 0, 0)) != Qundef &&
+ (RB_TYPE_P(e, T_STRING) || !NIL_P(e = rb_check_string_type(e)))) {
einfo = RSTRING_PTR(e);
elen = RSTRING_LEN(e);
}