Skip to content

Commit 435af7f

Browse files
[3.14] gh-151112: Move an assert that may fail in cfg_builder_check (GH-151153)
(cherry picked from commit 2d33810) Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 4f17349 commit 435af7f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/flowgraph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ cfg_builder_maybe_start_new_block(cfg_builder *g)
392392
static bool
393393
cfg_builder_check(cfg_builder *g)
394394
{
395-
assert(g->g_entryblock->b_iused > 0);
396395
for (basicblock *block = g->g_block_list; block != NULL; block = block->b_list) {
397396
assert(!_PyMem_IsPtrFreed(block));
398397
if (block->b_instr != NULL) {
@@ -3662,6 +3661,7 @@ _PyCfg_OptimizeCodeUnit(cfg_builder *g, PyObject *consts, PyObject *const_cache,
36623661
int nlocals, int nparams, int firstlineno)
36633662
{
36643663
assert(cfg_builder_check(g));
3664+
assert(g->g_entryblock->b_iused > 0);
36653665
/** Preprocessing **/
36663666
/* Map labels to targets and mark exception handlers */
36673667
RETURN_IF_ERROR(translate_jump_labels_to_targets(g->g_entryblock));

0 commit comments

Comments
 (0)