summaryrefslogtreecommitdiffstats
path: root/Modules/signalmodule.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-09-13 08:25:16 (GMT)
committerGitHub <noreply@github.com>2022-09-13 08:25:16 (GMT)
commit12c5f328d2479ac3432df5e266adc4e59adeabfe (patch)
treecdeb3338ca209b81ae0b4c321b52a0d9b19a762d /Modules/signalmodule.c
parent1756ffd66a38755cd45de51316d66266ae30e132 (diff)
downloadcpython-12c5f328d2479ac3432df5e266adc4e59adeabfe.zip
cpython-12c5f328d2479ac3432df5e266adc4e59adeabfe.tar.gz
cpython-12c5f328d2479ac3432df5e266adc4e59adeabfe.tar.bz2
GH-96754: Check whether the interpreter frame is complete before creating frame object. (GH-96776)
Diffstat (limited to 'Modules/signalmodule.c')
-rw-r--r--Modules/signalmodule.c3
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)) {