diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-09-13 10:56:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-13 10:56:27 (GMT) |
commit | c4cf745c723f19dbc5b304bfb21cf77ac9aa40b8 (patch) | |
tree | 97b44c31187781dddae878274c4e1bf316c4ba2c /Modules | |
parent | 8238fa91c175243061120856b14d735e8a740fa0 (diff) | |
download | cpython-c4cf745c723f19dbc5b304bfb21cf77ac9aa40b8.zip cpython-c4cf745c723f19dbc5b304bfb21cf77ac9aa40b8.tar.gz cpython-c4cf745c723f19dbc5b304bfb21cf77ac9aa40b8.tar.bz2 |
GH-96754: Check whether the interpreter frame is complete before creating frame object. (GH-96776) (#96787)
(cherry picked from commit 12c5f328d2479ac3432df5e266adc4e59adeabfe)
Co-authored-by: Mark Shannon <mark@hotpy.org>
Co-authored-by: Mark Shannon <mark@hotpy.org>
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/signalmodule.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index e3b37f1..0f30b4d 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -1832,6 +1832,9 @@ _PyErr_CheckSignalsTstate(PyThreadState *tstate) _Py_atomic_store(&is_tripped, 0); _PyInterpreterFrame *frame = tstate->cframe->current_frame; + while (frame && _PyFrame_IsIncomplete(frame)) { + frame = frame->previous; + } signal_state_t *state = &signal_global_state; for (int i = 1; i < Py_NSIG; i++) { if (!_Py_atomic_load_relaxed(&Handlers[i].tripped)) { |