diff options
author | Benjamin Peterson <benjamin@python.org> | 2016-09-06 20:42:17 -0700 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2016-09-06 20:42:17 -0700 |
commit | b59b27de94d39518be2c5c0cc843abaa2dfb931f (patch) | |
tree | 1e87e7a374f1dd42940da186c29d42b26f1755cd /Objects/unicodeobject.c | |
parent | 76ba81aa4b246a86a3a551e5a7bbe6857c68611e (diff) | |
parent | b56fcd18afe9b70c5f4bc1023a4de3e2fd1bead8 (diff) | |
download | cpython-b59b27de94d39518be2c5c0cc843abaa2dfb931f.tar.gz |
merge 3.5
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 2279442cc8..10ba57c570 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5229,7 +5229,7 @@ PyUnicode_DecodeUTF32Stateful(const char *s, mark is skipped, in all other modes, it is copied to the output stream as-is (giving a ZWNBSP character). */ if (bo == 0 && size >= 4) { - Py_UCS4 bom = (q[3] << 24) | (q[2] << 16) | (q[1] << 8) | q[0]; + Py_UCS4 bom = ((unsigned int)q[3] << 24) | (q[2] << 16) | (q[1] << 8) | q[0]; if (bom == 0x0000FEFF) { bo = -1; q += 4; @@ -5271,7 +5271,7 @@ PyUnicode_DecodeUTF32Stateful(const char *s, Py_ssize_t pos = writer.pos; if (le) { do { - ch = (q[3] << 24) | (q[2] << 16) | (q[1] << 8) | q[0]; + ch = ((unsigned int)q[3] << 24) | (q[2] << 16) | (q[1] << 8) | q[0]; if (ch > maxch) break; if (kind != PyUnicode_1BYTE_KIND && @@ -5283,7 +5283,7 @@ PyUnicode_DecodeUTF32Stateful(const char *s, } else { do { - ch = (q[0] << 24) | (q[1] << 16) | (q[2] << 8) | q[3]; + ch = ((unsigned int)q[0] << 24) | (q[1] << 16) | (q[2] << 8) | q[3]; if (ch > maxch) break; if (kind != PyUnicode_1BYTE_KIND && |