Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.8] bpo-38115: Deal with invalid bytecode offsets in lnotab (GH-16079) #16464

Merged
merged 1 commit into from Sep 28, 2019

Conversation

gpshead
Copy link
Member

@gpshead gpshead commented Sep 28, 2019

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)

https://bugs.python.org/issue38115

Automerge-Triggered-By: @gpshead

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 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) Sep 28, 2019
@gpshead gpshead added the 🤖 automerge label Sep 28, 2019
@gpshead gpshead merged commit 36c6fa9 into python:3.8 Sep 28, 2019
5 checks passed
@gpshead gpshead deleted the backport-c816503-3.8 branch Sep 28, 2019
jneb pushed a commit to jneb/cpython that referenced this issue Jan 13, 2021
…) (pythonGH-16464)

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA signed 🤖 automerge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants