Skip to content

Commit 807333d

Browse files
[3.13] gh-151112: Move an assert that may fail in cfg_builder_check (GH-151153) (#151315)
(cherry picked from commit 2d33810) Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 5c17ae6 commit 807333d

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
@@ -380,7 +380,6 @@ cfg_builder_maybe_start_new_block(cfg_builder *g)
380380
static bool
381381
cfg_builder_check(cfg_builder *g)
382382
{
383-
assert(g->g_entryblock->b_iused > 0);
384383
for (basicblock *block = g->g_block_list; block != NULL; block = block->b_list) {
385384
assert(!_PyMem_IsPtrFreed(block));
386385
if (block->b_instr != NULL) {
@@ -2486,6 +2485,7 @@ _PyCfg_OptimizeCodeUnit(cfg_builder *g, PyObject *consts, PyObject *const_cache,
24862485
int nlocals, int nparams, int firstlineno)
24872486
{
24882487
assert(cfg_builder_check(g));
2488+
assert(g->g_entryblock->b_iused > 0);
24892489
/** Preprocessing **/
24902490
/* Map labels to targets and mark exception handlers */
24912491
RETURN_IF_ERROR(translate_jump_labels_to_targets(g->g_entryblock));

0 commit comments

Comments
 (0)