Author: Antonio Cuni <[email protected]>
Branch: autoreds
Changeset: r58849:d817983192e9
Date: 2012-11-13 09:54 +0100
http://bitbucket.org/pypy/pypy/changeset/d817983192e9/

Log:    crash even when unstralsated if you call can_enter_jit on an
        autoreds driver

diff --git a/pypy/rlib/jit.py b/pypy/rlib/jit.py
--- a/pypy/rlib/jit.py
+++ b/pypy/rlib/jit.py
@@ -538,6 +538,8 @@
         _self._check_arguments(livevars)
 
     def can_enter_jit(_self, **livevars):
+        if _self.autoreds:
+            raise TypeError, "Cannot call can_enter_jit on a driver with 
reds='auto'"
         # special-cased by ExtRegistryEntry
         _self._check_arguments(livevars)
 
diff --git a/pypy/rlib/test/test_jit.py b/pypy/rlib/test/test_jit.py
--- a/pypy/rlib/test/test_jit.py
+++ b/pypy/rlib/test/test_jit.py
@@ -20,6 +20,7 @@
     assert driver.autoreds
     assert driver.reds == []
     assert driver.numreds is None
+    py.test.raises(TypeError, "driver.can_enter_jit(foo='something')")
     #
     py.test.raises(AssertionError, "JitDriver(greens=['foo'], reds='auto', 
confirm_enter_jit='something')")
     
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to