]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-94332: make it safe to call assemble_free when assemble_init has not been called...
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Thu, 30 Jun 2022 14:30:12 +0000 (15:30 +0100)
committerGitHub <noreply@github.com>
Thu, 30 Jun 2022 14:30:12 +0000 (15:30 +0100)
(cherry picked from commit be82d26570343dafc8a89be5a1a0e2f58d51a904)

Python/compile.c

index 6d800b21c162f9394b3f1b80da3b85a3402cbaf0..70a754b16d8881249be6eec0147fe6d8d96a5a9d 100644 (file)
@@ -8299,6 +8299,7 @@ assemble(struct compiler *c, int addNone)
     int j, nblocks;
     PyCodeObject *co = NULL;
     PyObject *consts = NULL;
+    memset(&a, 0, sizeof(struct assembler));
 
     /* Make sure every block that falls off the end returns None. */
     if (!c->u->u_curblock->b_return) {