summaryrefslogtreecommitdiff
path: root/numpy/linalg/lapack_litemodule.c
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2010-05-11 20:44:05 +0000
committerPauli Virtanen <pav@iki.fi>2010-05-11 20:44:05 +0000
commit010072e61e09eb9e755d8cb616c79e56814e5b59 (patch)
treee9faa506f7f64e876318c472d500baf9f72de1da /numpy/linalg/lapack_litemodule.c
parent4e2e78f908d8b8191b6257614096801c5d1af2f4 (diff)
downloadnumpy-010072e61e09eb9e755d8cb616c79e56814e5b59.tar.gz
BUG: linalg: check array byte order before passing it to lapack_lite (fixes #1482)
Diffstat (limited to 'numpy/linalg/lapack_litemodule.c')
-rw-r--r--numpy/linalg/lapack_litemodule.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/linalg/lapack_litemodule.c b/numpy/linalg/lapack_litemodule.c
index 53d9f01d5..869e55595 100644
--- a/numpy/linalg/lapack_litemodule.c
+++ b/numpy/linalg/lapack_litemodule.c
@@ -115,6 +115,12 @@ check_object(PyObject *ob, int t, char *obname,
"Parameter %s is not of type %s in lapack_lite.%s",
obname, tname, funname);
return 0;
+ } else if (((PyArrayObject *)ob)->descr->byteorder != '=' &&
+ ((PyArrayObject *)ob)->descr->byteorder != '|') {
+ PyErr_Format(LapackError,
+ "Parameter %s has non-native byte order in lapack_lite.%s",
+ obname, funname);
+ return 0;
} else {
return 1;
}