GH-100126: Skip incomplete frames in more places (GH-100613)

This commit is contained in:
Brandt Bucher 2023-01-09 12:20:04 -08:00 committed by GitHub
parent 2e80c2a976
commit 61762b9387
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 62 additions and 46 deletions

View file

@ -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;
}