summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-10-05 11:01:11 +0100
committerGitHub <noreply@github.com>2021-10-05 11:01:11 +0100
commitbd627eb7ed08a891dd1356756feb1ce2600358e4 (patch)
treefa2bb6db2fbdca1d08cd685d537c2db5d95e6192 /Python/sysmodule.c
parentef6196028f966f22d82930b66e1371e75c5df2f7 (diff)
downloadcpython-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.c4
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;