diff options
author | Mark Shannon <mark@hotpy.org> | 2021-04-07 09:52:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-07 09:52:07 (GMT) |
commit | 67969f5eb80844b68005181fd887bcf94c01fb40 (patch) | |
tree | 1ed9c72292f2f08159d2c6334933ec674ced963e /Python | |
parent | 1be456ae9d53bb1cba2b24fc86175c282d1c2169 (diff) | |
download | cpython-67969f5eb80844b68005181fd887bcf94c01fb40.zip cpython-67969f5eb80844b68005181fd887bcf94c01fb40.tar.gz cpython-67969f5eb80844b68005181fd887bcf94c01fb40.tar.bz2 |
Correct micro release number and add a couple of asserts. (GH-25224)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/compile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/compile.c b/Python/compile.c index c2fa1c0..65dacc2 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -6162,8 +6162,7 @@ stackdepth(struct compiler *c) entryblock = b; nblocks++; } - if (!entryblock) - return 0; + assert(entryblock!= NULL); stack = (basicblock **)PyObject_Malloc(sizeof(basicblock *) * nblocks); if (!stack) { PyErr_NoMemory(); @@ -6725,6 +6724,7 @@ assemble(struct compiler *c, int addNone) nblocks++; entryblock = b; } + assert(entryblock != NULL); if (insert_generator_prefix(c, entryblock)) { goto error; @@ -6732,7 +6732,7 @@ assemble(struct compiler *c, int addNone) /* Set firstlineno if it wasn't explicitly set. */ if (!c->u->u_firstlineno) { - if (entryblock && entryblock->b_instr && entryblock->b_instr->i_lineno) + if (entryblock->b_instr && entryblock->b_instr->i_lineno) c->u->u_firstlineno = entryblock->b_instr->i_lineno; else c->u->u_firstlineno = 1; |