summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-29 15:19:03 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-29 15:19:03 +0000
commitfca433e2fdc014b742d22dcbd0d62e4ad83a1cea (patch)
tree80c751f72cd2f72b9b09594f8b4b7049cf776169 /eval.c
parent74d6b68229bd9cd85bc412309aa1a17c9529b374 (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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 841b3671e3..d4dcaa1111 100644
--- a/eval.c
+++ b/eval.c
@@ -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);