summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2011-05-01 19:44:01 -0700
committerMark Wiebe <mwwiebe@gmail.com>2011-05-01 19:47:19 -0700
commit1611da9123c88714713e6d7c65be88c42cb65d1b (patch)
treeca47bb7e39b09cd61cee62a9ab25722521c9b233
parent26405fdf1ac0011d43d8904d88fe0296a92e2b42 (diff)
downloadnumpy-1611da9123c88714713e6d7c65be88c42cb65d1b.tar.gz
BUG: Fix 1.6rc1 crash in result_type on 32-bit Windows MKL builds
Thanks to Christoph Gohlke for tracking down the error. It appears to stem from the C preprocessor making the use of an undefined symbol become arbitrary behavior rather than a compile error.
-rw-r--r--numpy/core/src/multiarray/convert_datatype.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c
index 45b699cef..ee22ba646 100644
--- a/numpy/core/src/multiarray/convert_datatype.c
+++ b/numpy/core/src/multiarray/convert_datatype.c
@@ -1059,15 +1059,12 @@ PyArray_MinScalarType(PyArrayObject *arr)
int swap = !PyArray_ISNBO(dtype->byteorder);
int is_small_unsigned = 0;
/* An aligned memory buffer large enough to hold any type */
-#if NPY_SIZEOF_LONGLONG >= NPY_SIZEOF_CLONGDOUBLE
- npy_longlong value;
-#else
- npy_clongdouble value;
-#endif
+ npy_longlong value[4];
dtype->f->copyswap(&value, data, swap, NULL);
return PyArray_DescrFromType(
- min_scalar_type_num((char *)&value, dtype->type_num, &is_small_unsigned));
+ min_scalar_type_num((char *)&value,
+ dtype->type_num, &is_small_unsigned));
}
}
@@ -1240,11 +1237,7 @@ PyArray_ResultType(npy_intp narrs, PyArrayObject **arr,
int swap = !PyArray_ISNBO(tmp->byteorder);
int type_num;
/* An aligned memory buffer large enough to hold any type */
-#if NPY_SIZEOF_LONGLONG >= NPY_SIZEOF_CLONGDOUBLE
- npy_longlong value;
-#else
- npy_clongdouble value;
-#endif
+ npy_longlong value[4];
tmp->f->copyswap(&value, data, swap, NULL);
type_num = min_scalar_type_num((char *)&value,
tmp->type_num, &tmp_is_small_unsigned);