[pypy-svn] pypy jitypes2: conversion from arbitrary pointers to void* is always allowed

antocuni commits-noreply at bitbucket.org
Fri Mar 25 12:11:56 CET 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: jitypes2
Changeset: r42932:45edbdf84113
Date: 2011-03-25 12:10 +0100
http://bitbucket.org/pypy/pypy/changeset/45edbdf84113/

Log:	conversion from arbitrary pointers to void* is always allowed

diff --git a/lib_pypy/_ctypes/pointer.py b/lib_pypy/_ctypes/pointer.py
--- a/lib_pypy/_ctypes/pointer.py
+++ b/lib_pypy/_ctypes/pointer.py
@@ -120,7 +120,8 @@
         my_ffitype = type(self).get_ffi_argtype()
         # for now, we always allow types.pointer, else a lot of tests
         # break. We need to rethink how pointers are represented, though
-        if my_ffitype.deref_pointer() != ffitype.deref_pointer():
+        if my_ffitype.deref_pointer() != ffitype.deref_pointer() and \
+                ffitype is not _ffi.types.pointer:
             raise ArgumentError, "expected %s instance, got %s" % (type(self), ffitype)
         return self._get_buffer_value()
 


More information about the Pypy-commit mailing list