From 010072e61e09eb9e755d8cb616c79e56814e5b59 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Tue, 11 May 2010 20:44:05 +0000 Subject: BUG: linalg: check array byte order before passing it to lapack_lite (fixes #1482) --- numpy/linalg/lapack_litemodule.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'numpy/linalg') 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; } -- cgit v1.2.1