[pypy-commit] pypy virtual-arguments: give an error when the predicate of look_inside_iff has a different number of

cfbolz noreply at buildbot.pypy.org
Mon Apr 23 11:54:29 CEST 2012


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: virtual-arguments
Changeset: r54657:2ebd2356d035
Date: 2012-04-22 11:53 +0200
http://bitbucket.org/pypy/pypy/changeset/2ebd2356d035/

Log:	give an error when the predicate of look_inside_iff has a different
	number of arguments than the decorated function.

diff --git a/pypy/rlib/jit.py b/pypy/rlib/jit.py
--- a/pypy/rlib/jit.py
+++ b/pypy/rlib/jit.py
@@ -148,6 +148,8 @@
             thing._annspecialcase_ = "specialize:call_location"
 
         args = _get_args(func)
+        predicateargs = _get_args(predicate)
+        assert len(args) == len(predicateargs), "%s and predicate %s need the same numbers of arguments" % (func, predicate)
         d = {
             "dont_look_inside": dont_look_inside,
             "predicate": predicate,


More information about the pypy-commit mailing list