[pypy-commit] pypy ppc-jit-backend: Fixed hack in treating bools.

hager noreply at buildbot.pypy.org
Mon Oct 24 18:48:43 CEST 2011


Author: hager <sven.hager at uni-duesseldorf.de>
Branch: ppc-jit-backend
Changeset: r48381:064df4d72ec4
Date: 2011-10-24 18:48 +0200
http://bitbucket.org/pypy/pypy/changeset/064df4d72ec4/

Log:	Fixed hack in treating bools.

diff --git a/pypy/jit/backend/ppc/ppcgen/regalloc.py b/pypy/jit/backend/ppc/ppcgen/regalloc.py
--- a/pypy/jit/backend/ppc/ppcgen/regalloc.py
+++ b/pypy/jit/backend/ppc/ppcgen/regalloc.py
@@ -431,10 +431,10 @@
         ptr = arraydescr.is_array_of_pointers()
         scale = 0
         # XXX HACK, improve!
-        if not arraydescr._clsname.startswith("BoolArrayDescr"):
-            while (1 << scale) < size:
-                scale += 1
-            assert (1 << scale) == size
+        #if not arraydescr._clsname.startswith("BoolArrayDescr"):
+        while (1 << scale) < size:
+            scale += 1
+        assert (1 << scale) == size
         return size, scale, ofs, ofs_length, ptr
 
 def make_operation_list():
diff --git a/pypy/rpython/lltypesystem/ll2ctypes.py b/pypy/rpython/lltypesystem/ll2ctypes.py
--- a/pypy/rpython/lltypesystem/ll2ctypes.py
+++ b/pypy/rpython/lltypesystem/ll2ctypes.py
@@ -107,7 +107,7 @@
         rffi.LONGLONG:   ctypes.c_longlong,
         rffi.ULONGLONG:  ctypes.c_ulonglong,
         rffi.SIZE_T:     ctypes.c_size_t,
-        lltype.Bool:     ctypes.c_long, # XXX
+        lltype.Bool:     getattr(ctypes, "c_bool", ctypes.c_long),
         llmemory.Address:  ctypes.c_void_p,
         llmemory.GCREF:    ctypes.c_void_p,
         llmemory.WeakRef:  ctypes.c_void_p, # XXX


More information about the pypy-commit mailing list