1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (rb_make_exception): single argument to raise may be

string compatible object.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-12-08 16:47:47 +00:00
parent 70cf909fdd
commit b16baa9272
2 changed files with 8 additions and 3 deletions

View file

@ -72,6 +72,11 @@ Sat Dec 6 14:35:06 2008 NARUSE, Yui <naruse@ruby-lang.org>
* pack.c (pack_unpack): ditto.
Fri Dec 5 22:56:24 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_make_exception): single argument to raise may be
string compatible object.
Fri Dec 5 21:45:45 2008 Tadayoshi Funaba <tadf@dotrb.org>
* rational.c (nurat_{to_s,inspect}): performance improvement.

6
eval.c
View file

@ -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;