Skip to content

Commit cebc6f5

Browse files
authored
[3.13] gh-124746: remove assertion on exits having line numbers (#124762)
gh-124746: remove assertion in 3.13
1 parent e532760 commit cebc6f5

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

Python/flowgraph.c

-16
Original file line numberDiff line numberDiff line change
@@ -518,21 +518,6 @@ no_redundant_jumps(cfg_builder *g) {
518518
return true;
519519
}
520520

521-
static bool
522-
all_exits_have_lineno(basicblock *entryblock) {
523-
for (basicblock *b = entryblock; b != NULL; b = b->b_next) {
524-
for (int i = 0; i < b->b_iused; i++) {
525-
cfg_instr *instr = &b->b_instr[i];
526-
if (instr->i_opcode == RETURN_VALUE) {
527-
if (instr->i_loc.lineno < 0) {
528-
assert(0);
529-
return false;
530-
}
531-
}
532-
}
533-
}
534-
return true;
535-
}
536521
#endif
537522

538523
/***** CFG preprocessing (jump targets and exceptions) *****/
@@ -2500,7 +2485,6 @@ _PyCfg_OptimizeCodeUnit(cfg_builder *g, PyObject *consts, PyObject *const_cache,
25002485
RETURN_IF_ERROR(insert_superinstructions(g));
25012486

25022487
RETURN_IF_ERROR(push_cold_blocks_to_end(g));
2503-
assert(all_exits_have_lineno(g->g_entryblock));
25042488
RETURN_IF_ERROR(resolve_line_numbers(g, firstlineno));
25052489
return SUCCESS;
25062490
}

0 commit comments

Comments
 (0)