mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
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
This commit is contained in:
parent
74d6b68229
commit
fca433e2fd
4 changed files with 34 additions and 4 deletions
5
eval.c
5
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue