summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-09-13 08:25:16 (GMT)
committerGitHub <noreply@github.com>2022-09-13 08:25:16 (GMT)
commit12c5f328d2479ac3432df5e266adc4e59adeabfe (patch)
treecdeb3338ca209b81ae0b4c321b52a0d9b19a762d /Python/ceval.c
parent1756ffd66a38755cd45de51316d66266ae30e132 (diff)
downloadcpython-12c5f328d2479ac3432df5e266adc4e59adeabfe.zip
cpython-12c5f328d2479ac3432df5e266adc4e59adeabfe.tar.gz
cpython-12c5f328d2479ac3432df5e266adc4e59adeabfe.tar.bz2
GH-96754: Check whether the interpreter frame is complete before creating frame object. (GH-96776)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 20d0e1c..091b0eb 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -5113,9 +5113,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) {