summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-10-20 17:17:59 -0700
committerCharles Harris <charlesr.harris@gmail.com>2013-10-20 17:17:59 -0700
commit0d3289fa1d1a4f54980b65ad3b3f169a2a1afa59 (patch)
tree46cda17f06dfb3c9d773637dc68ec357f4d3f38b
parent11a931bbb935d9fe74c9b6382463f0ab840d0992 (diff)
parent97e6cadc835bc3b22da0c63591addf1a9455e965 (diff)
downloadnumpy-0d3289fa1d1a4f54980b65ad3b3f169a2a1afa59.tar.gz
Merge pull request #3954 from juliantaylor/memchr-bug
BUG: wrong boundary check in unrolled memchr
-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);