[Python-checkins] gh-94332: make it safe to call assemble_free when assemble_init has not been called (GH-94389) (GH-94442)

iritkatriel webhook-mailer at python.org
Thu Jun 30 10:30:24 EDT 2022


https://github.com/python/cpython/commit/48a739ec106dffabe89d67e79736c7dcf2f8f4a6
commit: 48a739ec106dffabe89d67e79736c7dcf2f8f4a6
branch: 3.11
author: Irit Katriel <1055913+iritkatriel at users.noreply.github.com>
committer: iritkatriel <1055913+iritkatriel at users.noreply.github.com>
date: 2022-06-30T15:30:12+01:00
summary:

gh-94332: make it safe to call assemble_free when assemble_init has not been called (GH-94389) (GH-94442)

(cherry picked from commit be82d26570343dafc8a89be5a1a0e2f58d51a904)

files:
M Python/compile.c

diff --git a/Python/compile.c b/Python/compile.c
index 6d800b21c162f..70a754b16d888 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -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) {



More information about the Python-checkins mailing list