summaryrefslogtreecommitdiffstats
path: root/Python/flowgraph.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2024-09-30 00:53:47 (GMT)
committerGitHub <noreply@github.com>2024-09-30 00:53:47 (GMT)
commitcebc6f51ee14dbeb90277f479e2293ae1ee64ccc (patch)
tree4483d9f2f6b65eb4b98e14e2116ea8abcd2570b4 /Python/flowgraph.c
parente532760f46957f867272dbbc5cc2bd779b5ac3a2 (diff)
downloadcpython-cebc6f51ee14dbeb90277f479e2293ae1ee64ccc.zip
cpython-cebc6f51ee14dbeb90277f479e2293ae1ee64ccc.tar.gz
cpython-cebc6f51ee14dbeb90277f479e2293ae1ee64ccc.tar.bz2
[3.13] gh-124746: remove assertion on exits having line numbers (#124762)
gh-124746: remove assertion in 3.13
Diffstat (limited to 'Python/flowgraph.c')
-rw-r--r--Python/flowgraph.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/Python/flowgraph.c b/Python/flowgraph.c
index b8d3f06..d12b602 100644
--- a/Python/flowgraph.c
+++ b/Python/flowgraph.c
@@ -518,21 +518,6 @@ no_redundant_jumps(cfg_builder *g) {
return true;
}
-static bool
-all_exits_have_lineno(basicblock *entryblock) {
- for (basicblock *b = entryblock; b != NULL; b = b->b_next) {
- for (int i = 0; i < b->b_iused; i++) {
- cfg_instr *instr = &b->b_instr[i];
- if (instr->i_opcode == RETURN_VALUE) {
- if (instr->i_loc.lineno < 0) {
- assert(0);
- return false;
- }
- }
- }
- }
- return true;
-}
#endif
/***** CFG preprocessing (jump targets and exceptions) *****/
@@ -2500,7 +2485,6 @@ _PyCfg_OptimizeCodeUnit(cfg_builder *g, PyObject *consts, PyObject *const_cache,
RETURN_IF_ERROR(insert_superinstructions(g));
RETURN_IF_ERROR(push_cold_blocks_to_end(g));
- assert(all_exits_have_lineno(g->g_entryblock));
RETURN_IF_ERROR(resolve_line_numbers(g, firstlineno));
return SUCCESS;
}