[pypy-svn] r50584 - pypy/branch/applevel-ctypes2/pypy/module/_rawffi

arigo at codespeak.net arigo at codespeak.net
Mon Jan 14 13:08:23 CET 2008


Author: arigo
Date: Mon Jan 14 13:08:22 2008
New Revision: 50584

Modified:
   pypy/branch/applevel-ctypes2/pypy/module/_rawffi/interp_rawffi.py
Log:
Forgot to check that the array is of length 1.


Modified: pypy/branch/applevel-ctypes2/pypy/module/_rawffi/interp_rawffi.py
==============================================================================
--- pypy/branch/applevel-ctypes2/pypy/module/_rawffi/interp_rawffi.py	(original)
+++ pypy/branch/applevel-ctypes2/pypy/module/_rawffi/interp_rawffi.py	Mon Jan 14 13:08:22 2008
@@ -326,6 +326,10 @@
             argtype = self.argtypes[i]
             w_arg = args_w[i]
             arg = space.interp_w(W_ArrayInstance, w_arg)
+            if arg.length != 1:
+                msg = ("Argument %d should be an array of length 1, "
+                       "got length %d" % (i+1, arg.length))
+                raise OperationError(space.w_TypeError, space.wrap(msg))
             if arg.shape.of != argtype:
                 msg = "Argument %d should be typecode %s, got %s" % (
                     i+1, argtype, arg.shape.of)



More information about the Pypy-commit mailing list