diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-19 02:42:08 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-19 02:42:08 +0000 |
commit | ab81cc4d809437fa1aa71b39bff2587abd8b03df (patch) | |
tree | 1ecf71d844bc1cc86d29263977ee0684ea32d23c /thread.c | |
parent | d61b1e9eaa4d68631d65f484c7dadf5eb80f115c (diff) |
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
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -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; } |