[Numpy-discussion] slice question and bug
clee at spiralis.merseine.nu
clee at spiralis.merseine.nu
Mon Apr 1 09:06:59 CST 2002
Hello,
I'm trying to track down a segv when I do the B[:] operation on an
array, "B", a that I've built in as a view on external data. During
the process I ran into the following code (Numeric-21.0):
/* {%c++%} */
extern int PyArray_Free(PyObject *op, char *ptr) {
PyArrayObject *ap = (PyArrayObject *)op;
int i, n;
if (ap->nd > 2) return -1;
if (ap->nd == 3) {
n = ap->dimensions[0];
for (i=0; i<n; i++) {
free(((char **)ptr)[i]);
}
}
if (ap->nd >= 2) {
free(ptr);
}
Py_DECREF(ap);
return 0;
}
/* {%c++%} */
The multiple, incompatible tests of ap->nd are the problem.
-chris
More information about the Numpy-discussion
mailing list