GH-96754: Check whether the interpreter frame is complete before creating frame object. (GH-96776) (#96787)

(cherry picked from commit 12c5f328d2)

Co-authored-by: Mark Shannon <mark@hotpy.org>

Co-authored-by: Mark Shannon <mark@hotpy.org>
This commit is contained in:
Miss Islington (bot) 2022-09-13 03:56:27 -07:00 committed by GitHub
parent 8238fa91c1
commit c4cf745c72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 3 deletions

View file

@ -5747,9 +5747,11 @@ error:
#endif
/* Log traceback info. */
PyFrameObject *f = _PyFrame_GetFrameObject(frame);
if (f != NULL) {
PyTraceBack_Here(f);
if (!_PyFrame_IsIncomplete(frame)) {
PyFrameObject *f = _PyFrame_GetFrameObject(frame);
if (f != NULL) {
PyTraceBack_Here(f);
}
}
if (tstate->c_tracefunc != NULL) {