[pypy-commit] pypy default: Translation fix. Of the kind "bah what a hack".

arigo noreply at buildbot.pypy.org
Wed Aug 31 21:39:17 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r46961:ad4f57500e04
Date: 2011-08-31 21:22 +0200
http://bitbucket.org/pypy/pypy/changeset/ad4f57500e04/

Log:	Translation fix. Of the kind "bah what a hack".

diff --git a/pypy/jit/backend/llsupport/descr.py b/pypy/jit/backend/llsupport/descr.py
--- a/pypy/jit/backend/llsupport/descr.py
+++ b/pypy/jit/backend/llsupport/descr.py
@@ -291,7 +291,7 @@
 
     def get_call_conv(self):
         from pypy.rlib.clibffi import get_call_conv
-        return get_call_conv(self.ffi_flags)
+        return get_call_conv(self.ffi_flags, True)
 
     def get_arg_types(self):
         return self.arg_classes
diff --git a/pypy/rlib/clibffi.py b/pypy/rlib/clibffi.py
--- a/pypy/rlib/clibffi.py
+++ b/pypy/rlib/clibffi.py
@@ -408,11 +408,12 @@
 FUNCFLAG_USE_ERRNO = 8
 FUNCFLAG_USE_LASTERROR = 16
 
-def get_call_conv(flags):
+def get_call_conv(flags, from_jit):
     if _WIN32 and (flags & FUNCFLAG_CDECL == 0):
         return FFI_STDCALL
     else:
         return FFI_DEFAULT_ABI
+get_call_conv._annspecialcase_ = 'specialize:arg(1)'     # hack :-/
 
 
 class AbstractFuncPtr(object):
@@ -443,7 +444,7 @@
                 elif restype.c_size <= 8:
                     restype = ffi_type_sint64
 
-        res = c_ffi_prep_cif(self.ll_cif, get_call_conv(flags),
+        res = c_ffi_prep_cif(self.ll_cif, get_call_conv(flags, False),
                              rffi.cast(rffi.UINT, argnum), restype,
                              self.ll_argtypes)
         if not res == FFI_OK:


More information about the pypy-commit mailing list