[pypy-commit] pypy default: Finally found out where to put the "assert".

arigo noreply at buildbot.pypy.org
Thu Nov 10 14:05:45 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r49274:edb7318580ea
Date: 2011-11-10 14:05 +0100
http://bitbucket.org/pypy/pypy/changeset/edb7318580ea/

Log:	Finally found out where to put the "assert".

diff --git a/pypy/jit/codewriter/call.py b/pypy/jit/codewriter/call.py
--- a/pypy/jit/codewriter/call.py
+++ b/pypy/jit/codewriter/call.py
@@ -212,7 +212,10 @@
         elidable = False
         loopinvariant = False
         if op.opname == "direct_call":
-            func = getattr(get_funcobj(op.args[0].value), '_callable', None)
+            funcobj = get_funcobj(op.args[0].value)
+            assert getattr(funcobj, 'calling_conv', 'c') == 'c', (
+                "%r: getcalldescr() with a non-default call ABI" % (op,))
+            func = getattr(funcobj, '_callable', None)
             elidable = getattr(func, "_elidable_function_", False)
             loopinvariant = getattr(func, "_jit_loop_invariant_", False)
             if loopinvariant:
diff --git a/pypy/rpython/lltypesystem/rffi.py b/pypy/rpython/lltypesystem/rffi.py
--- a/pypy/rpython/lltypesystem/rffi.py
+++ b/pypy/rpython/lltypesystem/rffi.py
@@ -125,6 +125,7 @@
                                  canraise=False,
                                  random_effects_on_gcobjs=
                                      random_effects_on_gcobjs,
+                                 calling_conv=calling_conv,
                                  **kwds)
     if isinstance(_callable, ll2ctypes.LL2CtypesCallable):
         _callable.funcptr = funcptr


More information about the pypy-commit mailing list