summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2022-06-30 11:26:29 (GMT)
committerGitHub <noreply@github.com>2022-06-30 11:26:29 (GMT)
commitbe82d26570343dafc8a89be5a1a0e2f58d51a904 (patch)
tree945103097cd89b30a02df4d7c2799cc1cd6838c4
parent21cbdae90ffdac047d27d1b83a5442fabcf89f7c (diff)
downloadcpython-be82d26570343dafc8a89be5a1a0e2f58d51a904.zip
cpython-be82d26570343dafc8a89be5a1a0e2f58d51a904.tar.gz
cpython-be82d26570343dafc8a89be5a1a0e2f58d51a904.tar.bz2
gh-94332: make it safe to call assemble_free when assemble_init has not been called (GH-94389)
-rw-r--r--Python/compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 74c21fd..59f8896 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -8554,6 +8554,8 @@ assemble(struct compiler *c, int addNone)
{
PyCodeObject *co = NULL;
PyObject *consts = NULL;
+ struct assembler a;
+ memset(&a, 0, sizeof(struct assembler));
int code_flags = compute_code_flags(c);
if (code_flags < 0) {
@@ -8683,7 +8685,6 @@ assemble(struct compiler *c, int addNone)
/* Create assembler */
- struct assembler a;
if (!assemble_init(&a, c->u->u_firstlineno))
goto error;