FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-38115: fix invalid lnotab after optimization by Yhg1s · Pull Request #15970 · python/cpython · GitHub

/ cpython Public
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .c  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Prev Previous commit
Next Next commit
Add lower bound check when walking backwards over the jump table.
  • Loading branch information
Yhg1s committed Sep 11, 2019
commit 11433f2558adaa4e66c9dabdf5bcac3471720ff7
2 changes: 1 addition & 1 deletion Python/peephole.c
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
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
* NOP (in case the NOP is a jump target), but positions past the end
* should point at the end, instead. This (currently) doesn't matter for
* jump targets, but it matters for lnotab. */
while (blocks[--i] > (codelen - nops - 1)) {
while (i-- > 0 && blocks[i] > (codelen - nops - 1)) {
blocks[i] = (codelen - nops - 1);
}

Expand Down

Back | FazBrowse Home | New Git URL