summaryrefslogtreecommitdiffstats
path: root/Python/executor_cases.c.h
diff options
context:
space:
mode:
authorTian Gao <gaogaotiantian@hotmail.com>2024-02-28 15:21:42 (GMT)
committerGitHub <noreply@github.com>2024-02-28 15:21:42 (GMT)
commit0a61e237009bf6b833e13ac635299ee063377699 (patch)
tree3f4b945c0e65971740f7a0a3b4d38c2624bcd9a7 /Python/executor_cases.c.h
parent9578288a3e5a7f42d1f3bec139c0c85b87775c90 (diff)
downloadcpython-0a61e237009bf6b833e13ac635299ee063377699.zip
cpython-0a61e237009bf6b833e13ac635299ee063377699.tar.gz
cpython-0a61e237009bf6b833e13ac635299ee063377699.tar.bz2
gh-107674: Improve performance of `sys.settrace` (GH-114986)
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r--Python/executor_cases.c.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index 0b1d759..20fab8f 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -20,7 +20,7 @@
uintptr_t eval_breaker = _Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker);
uintptr_t version = _PyFrame_GetCode(frame)->_co_instrumentation_version;
assert((version & _PY_EVAL_EVENTS_MASK) == 0);
- if (eval_breaker != version) goto deoptimize;
+ if (eval_breaker != version && tstate->tracing == 0) goto deoptimize;
break;
}