diff options
author | Gregory P. Smith <greg@krypto.org> | 2018-11-09 01:55:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-09 01:55:07 (GMT) |
commit | 49fa4a9f1ef387e16596f271414c855339eadf09 (patch) | |
tree | 87c3064e9afd4029016660e977d4cccf9c4d4f70 /Misc | |
parent | fd512d76456b65c529a5bc58d8cfe73e4a10de7a (diff) | |
download | cpython-49fa4a9f1ef387e16596f271414c855339eadf09.zip cpython-49fa4a9f1ef387e16596f271414c855339eadf09.tar.gz cpython-49fa4a9f1ef387e16596f271414c855339eadf09.tar.bz2 |
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.
https://github.com/python/cpython/commit/7db3c488335168993689ddae5914a28e16188447#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.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2018-11-08-15-00-58.bpo-35193.HzPS6R.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-11-08-15-00-58.bpo-35193.HzPS6R.rst b/Misc/NEWS.d/next/Core and Builtins/2018-11-08-15-00-58.bpo-35193.HzPS6R.rst new file mode 100644 index 0000000..dddebe1 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-11-08-15-00-58.bpo-35193.HzPS6R.rst @@ -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. |