[MATRIX-SIG] Seg fault with slice
viennet@lipn.univ-paris13.fr
viennet@lipn.univ-paris13.fr
Mon, 24 Nov 1997 20:02:59 GMT
Janko Hauser writes:
>
> Any ideas? seg faults are real show stopper in python.
>
Thanks to people like yourself, experimenting strange ideas, seg
faults are exceptional...
I didn't understood your example, but Python should not crash.
The bug is in NumPy/arrayobject.c. Here is a quick patch:
646,647c646,651
< if (!is_slice) op1 = PySequence_GetItem(op, i);
<
---
> if (!is_slice) {
> if (!(op1=PySequence_GetItem(op, i))) {
> PyErr_SetString(PyExc_IndexError, "invalid index");
> return -1;
> }
> }
_______________
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________