diff --git a/ChangeLog b/ChangeLog index 00c9d98b11..d357bb6f6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -72,6 +72,11 @@ Sat Dec 6 14:35:06 2008 NARUSE, Yui * pack.c (pack_unpack): ditto. +Fri Dec 5 22:56:24 2008 Yukihiro Matsumoto + + * eval.c (rb_make_exception): single argument to raise may be + string compatible object. + Fri Dec 5 21:45:45 2008 Tadayoshi Funaba * rational.c (nurat_{to_s,inspect}): performance improvement. diff --git a/eval.c b/eval.c index 636c225565..9c99711ce9 100644 --- a/eval.c +++ b/eval.c @@ -477,13 +477,13 @@ rb_make_exception(int argc, VALUE *argv) mesg = Qnil; switch (argc) { case 0: - mesg = Qnil; break; case 1: if (NIL_P(argv[0])) break; - if (TYPE(argv[0]) == T_STRING) { - mesg = rb_exc_new3(rb_eRuntimeError, argv[0]); + mesg = rb_check_string_type(argv[0]); + if (!NIL_P(mesg)) { + mesg = rb_exc_new3(rb_eRuntimeError, mesg); break; } n = 0;