From be82d26570343dafc8a89be5a1a0e2f58d51a904 Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Thu, 30 Jun 2022 12:26:29 +0100 Subject: gh-94332: make it safe to call assemble_free when assemble_init has not been called (GH-94389) --- Python/compile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v0.12