aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Objects/codeobject.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-07-01 11:08:20 +0100
committerGitHub <noreply@github.com>2022-07-01 11:08:20 +0100
commit544531de23d69f5b23883794fc7bb23a958a0fcb (patch)
treead88c0a6543127cd89027843ab441aa29dbdbc75 /Objects/codeobject.c
parent1df9449db24f16c9c96bdd7dc283a5062bca68e6 (diff)
downloadcpython-544531de23d69f5b23883794fc7bb23a958a0fcb.tar.gz
cpython-544531de23d69f5b23883794fc7bb23a958a0fcb.zip
GH-94262: Don't create frame objects for frames that aren't yet complete. (GH-94371)
Diffstat (limited to 'Objects/codeobject.c')
-rw-r--r--Objects/codeobject.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 6f2a8372403..d4fa0e38aed 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -638,11 +638,10 @@ PyCode_New(int argcount, int kwonlyargcount,
exceptiontable);
}
-static const char assert0[4] = {
- LOAD_ASSERTION_ERROR,
- 0,
- RAISE_VARARGS,
- 1
+static const char assert0[6] = {
+ RESUME, 0,
+ LOAD_ASSERTION_ERROR, 0,
+ RAISE_VARARGS, 1
};
PyCodeObject *
@@ -666,7 +665,7 @@ PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno)
if (filename_ob == NULL) {
goto failed;
}
- code_ob = PyBytes_FromStringAndSize(assert0, 4);
+ code_ob = PyBytes_FromStringAndSize(assert0, 6);
if (code_ob == NULL) {
goto failed;
}