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

(cherry picked from commit be82d26570)
This commit is contained in:
Irit Katriel 2022-06-30 15:30:12 +01:00 committed by GitHub
parent 20b8c9eee0
commit 48a739ec10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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) {