summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2013-10-20 20:16:12 +0200
committerJulian Taylor <jtaylor.debian@googlemail.com>2013-10-20 20:16:12 +0200
commit97e6cadc835bc3b22da0c63591addf1a9455e965 (patch)
tree308abcb65eb9d223379aef82d0eb2abc808cca0d /numpy/core
parent55d3ef5b81b709cc9d8ad6b13f75ca0f05f65276 (diff)
downloadnumpy-97e6cadc835bc3b22da0c63591addf1a9455e965.tar.gz
BUG: wrong boundary check in unrolled memchr
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/src/multiarray/common.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/common.h b/numpy/core/src/multiarray/common.h
index 44b8308f8..4b23b9442 100644
--- a/numpy/core/src/multiarray/common.h
+++ b/numpy/core/src/multiarray/common.h
@@ -148,7 +148,7 @@ npy_memchr(char * haystack, char needle,
/* usually find elements to skip path */
#if (defined HAVE___BUILTIN_CTZ && defined NPY_CPU_HAVE_UNALIGNED_ACCESS)
if (needle == 0 && stride == 1) {
- while (p < end - ((npy_uintp)end % sizeof(unsigned int))) {
+ while (p < end - (size % sizeof(unsigned int))) {
unsigned int v = *(unsigned int*)p;
if (v == 0) {
p += sizeof(unsigned int);