fix up r60782 and r60783.

* cont.c (cont_restore_thread): re-check a condition (pointed by nobu).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2017-11-16 04:37:02 +00:00
parent 7fbab01f77
commit c761514c76

9
cont.c
View File

@ -706,13 +706,12 @@ cont_restore_thread(rb_context_t *cont)
th->ec->errinfo = sec->errinfo; th->ec->errinfo = sec->errinfo;
/* trace on -> trace off */ /* trace on -> trace off */
if (sec->trace_arg == NULL && th->ec->trace_arg != NULL) { if (th->ec->trace_arg != NULL && sec->trace_arg == NULL) {
GET_VM()->trace_running--; GET_VM()->trace_running--;
} }
else { /* sec->trace_arg == NULL */ /* trace off -> trace on */
if (th->ec->trace_arg != NULL) { else if (th->ec->trace_arg == NULL && sec->trace_arg != NULL) {
GET_VM()->trace_running++; GET_VM()->trace_running++;
}
} }
th->ec->trace_arg = sec->trace_arg; th->ec->trace_arg = sec->trace_arg;