Commits

Armin Rigo committed 38bb0ad

Merge r77941 from trunk.

  • Participants
  • Parent commits b16b8c6
  • Branches 32ptr-on-64bit

Comments (0)

Files changed (1)

File pypy/module/_rawffi/array.py

 
 class W_ArrayInstance(W_DataInstance):
     def __init__(self, space, shape, length, address=r_uint(0)):
-        W_DataInstance.__init__(self, space, shape.size * length, address)
+        # XXX workaround for a bug in libffi on x86_64: make sure that
+        # we always have at least 8 bytes.  For W_ArrayInstances that are
+        # used as the result value of a function call, ffi_call() writes
+        # 8 bytes into it even if the function's result type asks for less.
+        memsize = shape.size * length
+        if memsize < 8:
+            memsize = 8
+        W_DataInstance.__init__(self, space, memsize, address)
         self.length = length
         self.shape = shape