Skip to content

Commit

Permalink
BUG: fix pointer arithmetic in _get_field_view
Browse files Browse the repository at this point in the history
Should have used PyArray_BYTES, not PyArray_DATA

Fixes numpy#6701
  • Loading branch information
ahaldane committed Nov 21, 2015
1 parent 65aa24a commit 6fd06c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion numpy/core/src/multiarray/mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ _get_field_view(PyArrayObject *arr, PyObject *ind, PyArrayObject **view)
PyArray_NDIM(arr),
PyArray_SHAPE(arr),
PyArray_STRIDES(arr),
((char *)PyArray_DATA(arr)) + offset,
PyArray_BYTES(arr) + offset,
PyArray_FLAGS(arr),
(PyObject *)arr);
if (*view == NULL) {
Expand Down

0 comments on commit 6fd06c7

Please sign in to comment.