Browse Source
bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418)
bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418)
Fix an off by one error in the peephole optimizer when checking for unreachable code beyond a return.
Do a bounds check within find_op so it can return before going past the end as a safety measure.
7db3c48833 (diff-a33329ae6ae0bb295d742f0caf93c137)
introduced this off by one error while fixing another one nearby.
This bug was shipped in all Python 3.6 and 3.7 releases.
The included unittest won't fail unless you do a clang msan build.
pull/10425/head
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 10 deletions
-
19Lib/test/test_compile.py
-
3Misc/NEWS.d/next/Core and Builtins/2018-11-08-15-00-58.bpo-35193.HzPS6R.rst
-
22Python/peephole.c
@ -0,0 +1,3 @@ |
|||
Fix an off by one error in the bytecode peephole optimizer where it could read |
|||
bytes beyond the end of bounds of an array when removing unreachable code. |
|||
This bug was present in every release of Python 3.6 and 3.7 until now. |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue