Document that lnotab can contain invalid bytecode offsets (because of terrible reasons that are difficult to fix). Make dis.findlinestarts() ignore invalid offsets in lnotab. All other uses of lnotab in CPython (various reimplementations of addr2line or line2addr in Python, C and gdb) already ignore this, because they take an address to look for, instead. Add tests for the result of dis.findlinestarts() on wacky constructs in test_peepholer.py, because it's the easiest place to add them. (cherry picked from commit c816503)
gpshead
changed the title
bpo-38115: Deal with invalid bytecode offsets in lnotab (GH-16079)
[3.8] bpo-38115: Deal with invalid bytecode offsets in lnotab (GH-16079)
Merged
gpshead deleted the backport-c816503-3.8 branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters