Commits

Antonio Cuni committed a1d33f4

make sure that we always pass the numeric address when converting to c_void_p

Comments (0)

Files changed (1)

lib_pypy/_ctypes/function.py

         newargs = []
         for argtype, arg in zip(argtypes, args):
             param = argtype.from_param(arg)
-            if self._is_primitive(argtype):
+            if argtype._type_ == 'P': # special-case for c_void_p
+                param = param._get_buffer_value()
+            elif self._is_primitive(argtype):
                 param = param.value
             newargs.append(param)
         return newargs