summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2009-12-02 22:07:16 +0000
committerTravis Oliphant <oliphant@enthought.com>2009-12-02 22:07:16 +0000
commitfd0866ffc7ca4c3d843b156c9a706b1a3e1ad67d (patch)
treeb3cad5f0b1804f7ba37762d51f38697743b1ac3c
parentb3f63a20ca2fcf46f8c83e77b1b399ab4d8d24b3 (diff)
downloadnumpy-fd0866ffc7ca4c3d843b156c9a706b1a3e1ad67d.tar.gz
Fix Ticket #1108 by initializing correctly the block of data corresponding to the identity for the ufunc used during reduceat with a buffer.
-rw-r--r--numpy/core/src/umath/ufunc_object.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 9c292b042..acd120407 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -2512,7 +2512,8 @@ construct_reduce(PyUFuncObject *self, PyArrayObject **arr, PyArrayObject *out,
else {
loop->obj = 0;
}
- if (loop->meth == ZERO_EL_REDUCELOOP) {
+ if ((loop->meth == ZERO_EL_REDUCELOOP) || \
+ ((operation == UFUNC_REDUCEAT) && (loop->meth == BUFFER_UFUNCLOOP))) {
idarr = _getidentity(self, otype, str);
if (idarr == NULL) {
goto fail;