From ab81cc4d809437fa1aa71b39bff2587abd8b03df Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 19 Sep 2017 02:42:08 +0000 Subject: thread.c: report then abort * thread.c (thread_start_func_2): report then abort on exception, if both are set. [ruby-core:79280] [Bug #13163] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'thread.c') diff --git a/thread.c b/thread.c index 1fd698c286..4b863eb3e6 100644 --- a/thread.c +++ b/thread.c @@ -637,19 +637,20 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s else if (rb_obj_is_kind_of(errinfo, rb_eSystemExit)) { /* exit on main_thread. */ } - else if (th->vm->thread_abort_on_exception || - th->abort_on_exception || RTEST(ruby_debug)) { - /* exit on main_thread */ - } - else if (th->report_on_exception) { - VALUE mesg = rb_thread_to_s(th->self); - rb_str_cat_cstr(mesg, " terminated with exception:\n"); - rb_write_error_str(mesg); - rb_threadptr_error_print(th, errinfo); - errinfo = Qnil; - } else { - errinfo = Qnil; + if (th->report_on_exception) { + VALUE mesg = rb_thread_to_s(th->self); + rb_str_cat_cstr(mesg, " terminated with exception:\n"); + rb_write_error_str(mesg); + rb_threadptr_error_print(th, errinfo); + } + if (th->vm->thread_abort_on_exception || + th->abort_on_exception || RTEST(ruby_debug)) { + /* exit on main_thread */ + } + else { + errinfo = Qnil; + } } th->value = Qnil; } -- cgit v1.2.3