Skip to content

Commit 2d33810

Browse files
gh-151112: Move an assert that may fail in cfg_builder_check (#151153)
1 parent f9ffca3 commit 2d33810

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
@@ -404,7 +404,6 @@ cfg_builder_maybe_start_new_block(cfg_builder *g)
404404
static bool
405405
cfg_builder_check(cfg_builder *g)
406406
{
407-
assert(g->g_entryblock->b_iused > 0);
408407
for (basicblock *block = g->g_block_list; block != NULL; block = block->b_list) {
409408
assert(!_PyMem_IsPtrFreed(block));
410409
if (block->b_instr != NULL) {
@@ -3762,6 +3761,7 @@ _PyCfg_OptimizeCodeUnit(cfg_builder *g, PyObject *consts, PyObject *const_cache,
37623761
int nlocals, int nparams, int firstlineno)
37633762
{
37643763
assert(cfg_builder_check(g));
3764+
assert(g->g_entryblock->b_iused > 0);
37653765
/** Preprocessing **/
37663766
/* Map labels to targets and mark exception handlers */
37673767
RETURN_IF_ERROR(translate_jump_labels_to_targets(g->g_entryblock));

0 commit comments

Comments
 (0)