[pypy-svn] r65150 - pypy/branch/pyjitpl5/pypy/rpython/lltypesystem

arigo at codespeak.net arigo at codespeak.net
Thu May 7 22:25:03 CEST 2009


Author: arigo
Date: Thu May  7 22:25:01 2009
New Revision: 65150

Modified:
   pypy/branch/pyjitpl5/pypy/rpython/lltypesystem/ll2ctypes.py
Log:
Fix for the case ctypes2lltype(lltype.Bool, 1).


Modified: pypy/branch/pyjitpl5/pypy/rpython/lltypesystem/ll2ctypes.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/rpython/lltypesystem/ll2ctypes.py	(original)
+++ pypy/branch/pyjitpl5/pypy/rpython/lltypesystem/ll2ctypes.py	Thu May  7 22:25:01 2009
@@ -733,6 +733,9 @@
         llobj = unichr(cobj)
     elif T is lltype.Signed:
         llobj = cobj
+    elif T is lltype.Bool:
+        assert cobj == True or cobj == False    # 0 and 1 work too
+        llobj = bool(cobj)
     elif T is lltype.SingleFloat:
         if isinstance(cobj, ctypes.c_float):
             cobj = cobj.value



More information about the Pypy-commit mailing list