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

@ -96,10 +96,7 @@ take_ownership(PyFrameObject *f, _PyInterpreterFrame *frame)
}
assert(!_PyFrame_IsIncomplete(frame));
assert(f->f_back == NULL);
_PyInterpreterFrame *prev = frame->previous;
while (prev && _PyFrame_IsIncomplete(prev)) {
prev = prev->previous;
}
_PyInterpreterFrame *prev = _PyFrame_GetFirstComplete(frame->previous);
frame->previous = NULL;
if (prev) {
assert(prev->owner != FRAME_OWNED_BY_CSTACK);