[pypy-commit] pypy ffi-backend: Translation fix

arigo noreply at buildbot.pypy.org
Sat Jul 28 17:37:48 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: ffi-backend
Changeset: r56496:4ea7adb9cdaa
Date: 2012-07-28 16:33 +0200
http://bitbucket.org/pypy/pypy/changeset/4ea7adb9cdaa/

Log:	Translation fix

diff --git a/pypy/module/_cffi_backend/ctypeobj.py b/pypy/module/_cffi_backend/ctypeobj.py
--- a/pypy/module/_cffi_backend/ctypeobj.py
+++ b/pypy/module/_cffi_backend/ctypeobj.py
@@ -116,6 +116,10 @@
             # obscure hack when untranslated, maybe, approximate, don't use
             if isinstance(align, llmemory.FieldOffset):
                 align = rffi.sizeof(align.TYPE.y)
+        else:
+            # a different hack when translated, to avoid seeing constants
+            # of a symbolic integer type
+            align = llmemory.raw_malloc_usage(align)
         return align
 
     def _alignof(self):


More information about the pypy-commit mailing list