From dd8299b40e9128b18abd7df1adb462f53bb2493a Mon Sep 17 00:00:00 2001 From: David Cournapeau Date: Mon, 9 Mar 2009 15:26:28 +0000 Subject: BUG: when a new type is required, and the fast clip function is updated, make sure the function pointer is not NULL - if it is, fall back to slow array. --- numpy/core/src/multiarraymodule.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'numpy') diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c index 6e3a9d98e..9c6454d3f 100644 --- a/numpy/core/src/multiarraymodule.c +++ b/numpy/core/src/multiarraymodule.c @@ -1416,6 +1416,9 @@ PyArray_Clip(PyArrayObject *self, PyObject *min, PyObject *max, PyArrayObject *o PyArray_ScalarKind(self->descr->type_num, NULL)) { indescr = _array_small_type(newdescr, self->descr); func = indescr->f->fastclip; + if (func == NULL) { + return _slow_array_clip(self, min, max, out); + } } else { indescr = self->descr; -- cgit v1.2.1