summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2017-05-12 18:48:30 +0200
committerJulian Taylor <jtaylor.debian@googlemail.com>2017-05-12 19:02:22 +0200
commite75be11d9a43a893fc4c0b943e01ef0e9f46e219 (patch)
tree9ca6911812075b3ccd453d9c87dba0bd0f9329bd
parentfb67d49bf1e84c58833b8d4920397cee866e8daf (diff)
downloadnumpy-e75be11d9a43a893fc4c0b943e01ef0e9f46e219.tar.gz
BUG: only elide basic dtypes in unary ops
As in binary operations, only elide unary operations on basic types to avoid odd interactions e.g. with user dtypes.
-rw-r--r--numpy/core/src/multiarray/temp_elide.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/temp_elide.c b/numpy/core/src/multiarray/temp_elide.c
index fae6763e4..c4673bd4b 100644
--- a/numpy/core/src/multiarray/temp_elide.c
+++ b/numpy/core/src/multiarray/temp_elide.c
@@ -359,7 +359,7 @@ can_elide_temp_unary(PyArrayObject * m1)
{
int cannot;
if (Py_REFCNT(m1) != 1 || !PyArray_CheckExact(m1) ||
- PyArray_DESCR(m1)->type_num == NPY_VOID ||
+ PyArray_DESCR(m1)->type_num >= NPY_OBJECT ||
!(PyArray_FLAGS(m1) & NPY_ARRAY_OWNDATA) ||
PyArray_NBYTES(m1) < NPY_MIN_ELIDE_BYTES) {
return 0;