summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2011-02-08 13:40:17 -0800
committerMark Wiebe <mwwiebe@gmail.com>2011-02-08 13:40:17 -0800
commit5d06dcaf73c2adf287a55565a5190636839ab65c (patch)
tree6ceef66746575e081830dcf96134b793ec3d6fdb
parent15850ffd3118c28d914f7156b4186f36877de98e (diff)
downloadnumpy-5d06dcaf73c2adf287a55565a5190636839ab65c.tar.gz
BUG: umath: Fix reference usage after Py_DECREF
Because of the details, I don't think this was causing a crash, but it's a bug nonetheless.
-rw-r--r--numpy/core/src/umath/ufunc_object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 9006a9db6..539806ca9 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -1014,12 +1014,12 @@ ufunc_loop_matches(PyUFuncObject *self,
}
if (!PyArray_CanCastTypeTo(tmp, PyArray_DESCR(op[i]),
output_casting)) {
- Py_DECREF(tmp);
if (!(*out_no_castable_output)) {
*out_no_castable_output = 1;
*out_err_src_typecode = tmp->type;
*out_err_dst_typecode = PyArray_DESCR(op[i])->type;
}
+ Py_DECREF(tmp);
return 0;
}
Py_DECREF(tmp);