diff options
author | Mark Shannon <mark@hotpy.org> | 2021-10-05 11:01:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-05 11:01:11 +0100 |
commit | bd627eb7ed08a891dd1356756feb1ce2600358e4 (patch) | |
tree | fa2bb6db2fbdca1d08cd685d537c2db5d95e6192 /Python/sysmodule.c | |
parent | ef6196028f966f22d82930b66e1371e75c5df2f7 (diff) | |
download | cpython-git-bd627eb7ed08a891dd1356756feb1ce2600358e4.tar.gz |
bpo-43760: Check for tracing using 'bitwise or' instead of branch in dispatch. (GH-28723)
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 6e7e45bf3f..f2cd3a9d5a 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -268,7 +268,7 @@ sys_audit_tstate(PyThreadState *ts, const char *event, break; } if (canTrace) { - ts->cframe->use_tracing = (ts->c_tracefunc || ts->c_profilefunc); + ts->cframe->use_tracing = (ts->c_tracefunc || ts->c_profilefunc) ? 255 : 0; ts->tracing--; } PyObject* args[2] = {eventName, eventArgs}; @@ -283,7 +283,7 @@ sys_audit_tstate(PyThreadState *ts, const char *event, Py_DECREF(o); Py_CLEAR(hook); } - ts->cframe->use_tracing = (ts->c_tracefunc || ts->c_profilefunc); + ts->cframe->use_tracing = (ts->c_tracefunc || ts->c_profilefunc) ? 255 : 0; ts->tracing--; if (_PyErr_Occurred(ts)) { goto exit; |