diff options
author | Jay Bourque <jay.bourque@continuum.io> | 2012-12-13 16:08:49 -0600 |
---|---|---|
committer | Jay Bourque <jay.bourque@continuum.io> | 2013-08-16 16:39:31 -0500 |
commit | d6fa103630fc8d006b78b78ff5cf422f5a615ea7 (patch) | |
tree | 8c985a830814b752c168ef6bd4d4cf38f30aed0c /numpy | |
parent | 0d087dcc30f04aa4afb2fbcadd983192336d77ad (diff) | |
download | numpy-d6fa103630fc8d006b78b78ff5cf422f5a615ea7.tar.gz |
Fix for crash when PyArray_MapIterSwapAxes is called
Set up default iteraxes array values in call to MapIterBind().
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/multiarray/mapping.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c index 5f2a7f7a4..5a047ee88 100644 --- a/numpy/core/src/multiarray/mapping.c +++ b/numpy/core/src/multiarray/mapping.c @@ -1793,6 +1793,16 @@ PyArray_MapIterBind(PyArrayMapIterObject *mit, PyArrayObject *arr) goto fail; } + /* Set up default iteraxes array values */ + n = PyArray_NDIM(arr); + for (i = 0; i < n; i++) { + mit->iteraxes[i] = i; + } + /* no subspace iteration needed. Finish up and Return */ + if (subnd == 0) { + goto finish; + } + /* * all indexing arrays have been converted to 0 * therefore we can extract the subspace with a simple |