summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-10-24 19:02:58 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-10-24 19:02:58 (GMT)
commitbe80fc9a843e3c51d1030d3eab52d6287e5aef3a (patch)
treeeb5b7b5fd1dcf66a70a7cc566772d7ad581dbeb9 /Modules
parentb82a3dc2409e68dbd20d1991ba2e9d1c490c67a3 (diff)
downloadcpython-be80fc9a843e3c51d1030d3eab52d6287e5aef3a.zip
cpython-be80fc9a843e3c51d1030d3eab52d6287e5aef3a.tar.gz
cpython-be80fc9a843e3c51d1030d3eab52d6287e5aef3a.tar.bz2
Issue #19327: Fixed the working of regular expressions with too big charset.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_sre.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_sre.c b/Modules/_sre.c
index 5bcc387..787809f 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -451,7 +451,7 @@ SRE_CHARSET(SRE_CODE* set, SRE_CODE ch)
count = *(set++);
if (sizeof(SRE_CODE) == 2) {
- block = ((char*)set)[ch >> 8];
+ block = ((unsigned char*)set)[ch >> 8];
set += 128;
if (set[block*16 + ((ch & 255)>>4)] & (1 << (ch & 15)))
return ok;
@@ -461,7 +461,7 @@ SRE_CHARSET(SRE_CODE* set, SRE_CODE ch)
/* !(c & ~N) == (c < N+1) for any unsigned c, this avoids
* warnings when c's type supports only numbers < N+1 */
if (!(ch & ~65535))
- block = ((char*)set)[ch >> 8];
+ block = ((unsigned char*)set)[ch >> 8];
else
block = -1;
set += 64;