diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b21a7fc7af35..6e7975039a55 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,7 +6,7 @@ trigger: - master - maintenance/* jobs: -- job: Linux_Python_36_32bit_full +- job: Linux_Python_36_32bit_full_with_asserts pool: vmIMage: 'ubuntu-16.04' steps: @@ -26,7 +26,8 @@ jobs: cp ./usr/local/include/* /usr/include && \ cd ../numpy && \ NUMPY_EXPERIMENTAL_ARRAY_FUNCTION=1 \ - F77=gfortran-5 F90=gfortran-5 python3 runtests.py --mode=full -- -rsx --junitxml=junit/test-results.xml" + F77=gfortran-5 F90=gfortran-5 \ + CFLAGS=-UNDEBUG python3 runtests.py --mode=full -- -rsx --junitxml=junit/test-results.xml" displayName: 'Run 32-bit Ubuntu Docker Build / Tests' - task: PublishTestResults@2 inputs: diff --git a/numpy/core/src/common/array_assign.c b/numpy/core/src/common/array_assign.c index ac3fdbef772f..02a423e3a76b 100644 --- a/numpy/core/src/common/array_assign.c +++ b/numpy/core/src/common/array_assign.c @@ -125,9 +125,13 @@ raw_array_is_aligned(int ndim, npy_intp *shape, return npy_is_aligned((void *)align_check, alignment); } - else { + else if (alignment == 1) { return 1; } + else { + /* always return false for alignment == 0, which means cannot-be-aligned */ + return 0; + } } NPY_NO_EXPORT int diff --git a/numpy/core/src/common/array_assign.h b/numpy/core/src/common/array_assign.h index 07438c5e8dba..69ef56bb4a8c 100644 --- a/numpy/core/src/common/array_assign.h +++ b/numpy/core/src/common/array_assign.h @@ -87,8 +87,10 @@ broadcast_strides(int ndim, npy_intp *shape, /* * Checks whether a data pointer + set of strides refers to a raw - * array whose elements are all aligned to a given alignment. - * alignment should be a power of two. + * array whose elements are all aligned to a given alignment. Returns + * 1 if data is aligned to alignment or 0 if not. + * alignment should be a power of two, or may be the sentinel value 0 to mean + * cannot-be-aligned, in which case 0 (false) is always returned. */ NPY_NO_EXPORT int raw_array_is_aligned(int ndim, npy_intp *shape,