summaryrefslogtreecommitdiffstats
path: root/Python/pystate.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 /Python/pystate.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 'Python/pystate.c')
-rw-r--r--Python/pystate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index a0d61d7..23e9d24 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -1406,6 +1406,9 @@ _PyThread_CurrentFrames(void)
PyThreadState *t;
for (t = i->threads.head; t != NULL; t = t->next) {
_PyInterpreterFrame *frame = t->cframe->current_frame;
+ while (frame && _PyFrame_IsIncomplete(frame)) {
+ frame = frame->previous;
+ }
if (frame == NULL) {
continue;
}