summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-09-13 10:56:27 (GMT)
committerGitHub <noreply@github.com>2022-09-13 10:56:27 (GMT)
commitc4cf745c723f19dbc5b304bfb21cf77ac9aa40b8 (patch)
tree97b44c31187781dddae878274c4e1bf316c4ba2c /Python/pystate.c
parent8238fa91c175243061120856b14d735e8a740fa0 (diff)
downloadcpython-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 '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 12ebbe3..4250653 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -1391,6 +1391,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;
}