diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-29 15:19:03 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-29 15:19:03 +0000 |
commit | fca433e2fdc014b742d22dcbd0d62e4ad83a1cea (patch) | |
tree | 80c751f72cd2f72b9b09594f8b4b7049cf776169 /eval.c | |
parent | 74d6b68229bd9cd85bc412309aa1a17c9529b374 (diff) |
merge revision(s) r45178,r45180,r45183: [Backport #9568]
eval.c: remove unneeded GC guard
* eval.c (setup_exception): remove RB_GC_GUARD which is no longer
needed since r41598.
* eval.c (setup_exception): preserve errinfo across calling #to_s
method on the exception. [ruby-core:61091] [Bug #9568]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -507,9 +507,12 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg) !rb_obj_is_kind_of(e, rb_eSystemExit)) { int status; + mesg = e; PUSH_TAG(); if ((status = EXEC_TAG()) == 0) { - RB_GC_GUARD(e) = rb_obj_as_string(e); + th->errinfo = Qnil; + e = rb_obj_as_string(mesg); + th->errinfo = mesg; if (file && line) { warn_printf("Exception `%s' at %s:%d - %"PRIsVALUE"\n", rb_obj_classname(th->errinfo), file, line, e); |