summaryrefslogtreecommitdiff
path: root/numpy/core/src/ufuncobject.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2007-10-17 04:06:29 +0000
committerTravis Oliphant <oliphant@enthought.com>2007-10-17 04:06:29 +0000
commitbee10707e0d6537981458f4d75eb9a198a7728bc (patch)
tree87b449a848d5a74bdbebad6a889937ee23f7f718 /numpy/core/src/ufuncobject.c
parent8095de4f7da6f50b129f76a9e261abe8ebc37b9a (diff)
downloadnumpy-bee10707e0d6537981458f4d75eb9a198a7728bc.tar.gz
Fix ticket #592: segfault with bitwise_or inplace
Diffstat (limited to 'numpy/core/src/ufuncobject.c')
-rw-r--r--numpy/core/src/ufuncobject.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/numpy/core/src/ufuncobject.c b/numpy/core/src/ufuncobject.c
index ecedf7822..da0c31e36 100644
--- a/numpy/core/src/ufuncobject.c
+++ b/numpy/core/src/ufuncobject.c
@@ -1344,7 +1344,8 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
loop->meth = BUFFER_UFUNCLOOP;
loop->needbuffer[i] = 1;
}
- if (!loop->obj && mps[i]->descr->type_num == PyArray_OBJECT) {
+ if (!loop->obj && ((mps[i]->descr->type_num == PyArray_OBJECT) ||
+ (arg_types[i] == PyArray_OBJECT))) {
loop->obj = 1;
}
}
@@ -1486,7 +1487,7 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps,
/* compute the element size */
for (i=0; i<self->nargs;i++) {
- if (!loop->needbuffer) continue;
+ if (!loop->needbuffer[i]) continue;
if (arg_types[i] != mps[i]->descr->type_num) {
descr = PyArray_DescrFromType(arg_types[i]);
if (loop->steps[i])
@@ -1913,6 +1914,7 @@ PyUFunc_GenericFunction(PyUFuncObject *self, PyObject *args, PyObject *kwds,
}
/* cast to the other buffer if necessary */
if (loop->cast[i]) {
+ /* fprintf(stderr, "casting... %d, %p %p\n", i, buffer[i]); */
loop->cast[i](buffer[i],
castbuf[i],
(intp) datasize[i],
@@ -1926,6 +1928,7 @@ PyUFunc_GenericFunction(PyUFuncObject *self, PyObject *args, PyObject *kwds,
for (i=self->nin; i<self->nargs; i++) {
if (!needbuffer[i]) continue;
if (loop->cast[i]) {
+ /* fprintf(stderr, "casting back... %d, %p", i, castbuf[i]); */
loop->cast[i](castbuf[i],
buffer[i],
(intp) datasize[i],