diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-10 02:32:56 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-10 02:32:56 +0000 |
commit | 3c35067cfc20c510f26d16466015d2195736801b (patch) | |
tree | 0b413ba08cc79db1243d83a6f989a88d5ad29f11 /thread.c | |
parent | acbf49de470c03cd5071ac563127572c89c1caeb (diff) |
merge revision(s) 59963: [Backport #13163]
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/branches/ruby_2_4@62711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -630,19 +630,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_inspect(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_inspect(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; } |