[Numpy-svn] r8406 - trunk/numpy/linalg

numpy-svn at scipy.org numpy-svn at scipy.org
Tue May 11 16:44:05 EDT 2010


Author: ptvirtan
Date: 2010-05-11 15:44:05 -0500 (Tue, 11 May 2010)
New Revision: 8406

Modified:
   trunk/numpy/linalg/lapack_litemodule.c
Log:
BUG: linalg: check array byte order before passing it to lapack_lite (fixes #1482)

Modified: trunk/numpy/linalg/lapack_litemodule.c
===================================================================
--- trunk/numpy/linalg/lapack_litemodule.c	2010-05-11 20:42:42 UTC (rev 8405)
+++ trunk/numpy/linalg/lapack_litemodule.c	2010-05-11 20:44:05 UTC (rev 8406)
@@ -115,6 +115,12 @@
                      "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;
     }




More information about the Numpy-svn mailing list