Author: David Schneider <[email protected]>
Branch:
Changeset: r64893:45b0965e4d99
Date: 2013-06-16 10:48 -0500
http://bitbucket.org/pypy/pypy/changeset/45b0965e4d99/
Log: Fix for the alignment calculation of anonymous and zero width
bitfields on ARM
diff --git a/pypy/module/_cffi_backend/newtype.py
b/pypy/module/_cffi_backend/newtype.py
--- a/pypy/module/_cffi_backend/newtype.py
+++ b/pypy/module/_cffi_backend/newtype.py
@@ -5,6 +5,7 @@
from rpython.rlib.objectmodel import specialize
from rpython.rlib.rarithmetic import ovfcheck
from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.rtyper.tool import rffi_platform
from pypy.module._cffi_backend import (ctypeobj, ctypeprim, ctypeptr,
ctypearray, ctypestruct, ctypevoid, ctypeenum)
@@ -121,6 +122,7 @@
else:
DEFAULT_SFLAGS = 0
+_ARM = rffi_platform.getdefined('__arm__', '')
@unwrap_spec(name=str)
def new_struct_type(space, name):
@@ -180,7 +182,7 @@
# field is an anonymous bitfield
falign = ftype.alignof()
do_align = True
- if fbitsize >= 0:
+ if fbitsize >= 0 and not _ARM:
if (sflags & SF_MSVC_BITFIELDS) == 0:
# GCC: anonymous bitfields (of any size) don't cause alignment
do_align = (fname != '')
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit