Description
Bug report
Bug description:
The following code causes a crash on cpython 3.13 branch (f5289c4) and the current main.
import ast
code="""
try:
if name_4:
pass
else:
pass
except* name_0:
pass
else:
name_4
"""
tree = ast.parse(code)
for node in ast.walk(tree):
if hasattr(node,"lineno"):
del node.lineno
del node.end_lineno
del node.col_offset
del node.end_col_offset
compile(ast.fix_missing_locations(tree), "<file>", "exec")
output (Python 3.13.0a3+):
python: Python/flowgraph.c:511: no_redundant_jumps: Assertion `0' failed.
I bisected the problem down to 2091fb2.
@iritkatriel can you take a look at it?
CPython versions tested on:
3.13, CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-120367: fix removal of redundant NOPs and jumps after reordering hot-cold blocks #120425
- [3.13] gh-120367: fix removal of redundant NOPs and jumps after reordering hot-cold blocks (GH-120425) #120621
- gh-120367: fix bug where compiler detects redundant jump after pseudo op replacement #120714
- [3.13] gh-120367: fix bug where compiler detects redundant jump after pseudo op replacement (GH-120714) #120716