From e4211600a94143266970e4edb925aed17e5abc56 Mon Sep 17 00:00:00 2001 From: nagachika Date: Sun, 2 Mar 2014 16:30:04 +0000 Subject: merge revision(s) r45178,r45179,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_0_0@45251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index b5f41e6fcd..e8dc008a53 100644 --- a/eval.c +++ b/eval.c @@ -467,9 +467,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 - %s\n", rb_obj_classname(th->errinfo), -- cgit v1.2.3