summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2023-01-09 20:20:04 (GMT)
committerGitHub <noreply@github.com>2023-01-09 20:20:04 (GMT)
commit61762b93871419b34f02d83cee5ca0d94d4a2903 (patch)
tree286b9aff961b5435e2d34894857a603ae86aa5c6 /Python/pystate.c
parent2e80c2a976c13dcb69a654b386164dca362295a3 (diff)
downloadcpython-61762b93871419b34f02d83cee5ca0d94d4a2903.zip
cpython-61762b93871419b34f02d83cee5ca0d94d4a2903.tar.gz
cpython-61762b93871419b34f02d83cee5ca0d94d4a2903.tar.bz2
GH-100126: Skip incomplete frames in more places (GH-100613)
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index f52fc38..f2f571f 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -1302,10 +1302,7 @@ PyFrameObject*
PyThreadState_GetFrame(PyThreadState *tstate)
{
assert(tstate != NULL);
- _PyInterpreterFrame *f = tstate->cframe->current_frame;
- while (f && _PyFrame_IsIncomplete(f)) {
- f = f->previous;
- }
+ _PyInterpreterFrame *f = _PyThreadState_GetFrame(tstate);
if (f == NULL) {
return NULL;
}
@@ -1431,9 +1428,7 @@ _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;
- }
+ frame = _PyFrame_GetFirstComplete(frame);
if (frame == NULL) {
continue;
}