Author: Matti Picus <[email protected]>
Branch: unicode-utf8
Changeset: r95668:e0d70d85d65c
Date: 2019-01-18 13:30 +0200
http://bitbucket.org/pypy/pypy/changeset/e0d70d85d65c/

Log:    check for negative index

diff --git a/rpython/rlib/rutf8.py b/rpython/rlib/rutf8.py
--- a/rpython/rlib/rutf8.py
+++ b/rpython/rlib/rutf8.py
@@ -570,6 +570,8 @@
     logarithmic in the length of the string, plus some constant that
     is not tiny either.
     """
+    if bytepos < 0:
+        return bytepos
     index_min = 0
     index_max = len(storage) - 1
     while index_min < index_max:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to