diff options
author | Tian Gao <gaogaotiantian@hotmail.com> | 2024-07-15 23:11:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-15 23:11:02 (GMT) |
commit | 2b1b68939b15b913080a3403e3ba18e2a1f520ef (patch) | |
tree | 76797041a09903bd1dedee08b96bc9ff0edd09dc /Python | |
parent | 4134261ab831863565fefc7a04d05a1fc1bca2f8 (diff) | |
download | cpython-2b1b68939b15b913080a3403e3ba18e2a1f520ef.zip cpython-2b1b68939b15b913080a3403e3ba18e2a1f520ef.tar.gz cpython-2b1b68939b15b913080a3403e3ba18e2a1f520ef.tar.bz2 |
gh-121814: Only check f_trace_opcodes if Python frame exists (#121818)
Co-authored-by: Matt Wozniski <godlygeek@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r-- | Python/legacy_tracing.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/legacy_tracing.c b/Python/legacy_tracing.c index 7411803..1103d99 100644 --- a/Python/legacy_tracing.c +++ b/Python/legacy_tracing.c @@ -605,7 +605,7 @@ _PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg) (1 << PY_MONITORING_EVENT_STOP_ITERATION); PyFrameObject* frame = PyEval_GetFrame(); - if (frame->f_trace_opcodes) { + if (frame && frame->f_trace_opcodes) { int ret = _PyEval_SetOpcodeTrace(frame, true); if (ret != 0) { return ret; |