]> 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 11:26:29 +0000 (12:26 +0100)
committerGitHub <noreply@github.com>
Thu, 30 Jun 2022 11:26:29 +0000 (12:26 +0100)
Python/compile.c

index 74c21fd69f80c0360b3957a519cc4d9d80b3e32e..59f88965bb29c4b97243fd9d8c6666ac48850cb3 100644 (file)
@@ -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;