[pypy-svn] r65200 - pypy/trunk/pypy/lang/prolog/builtin

arigo at codespeak.net arigo at codespeak.net
Sun May 10 16:29:41 CEST 2009


Author: arigo
Date: Sun May 10 16:29:40 2009
New Revision: 65200

Modified:
   pypy/trunk/pypy/lang/prolog/builtin/atomconstruction.py
Log:
Fix for pypy.lang.test.test_translation.
This makes sure stopbefore is annotated "nonneg",
as required by the following s.find().


Modified: pypy/trunk/pypy/lang/prolog/builtin/atomconstruction.py
==============================================================================
--- pypy/trunk/pypy/lang/prolog/builtin/atomconstruction.py	(original)
+++ pypy/trunk/pypy/lang/prolog/builtin/atomconstruction.py	Sun May 10 16:29:40 2009
@@ -66,10 +66,11 @@
         stopbefore = len(s) + 1
     else:
         startbefore = helper.unwrap_int(before)
-        stopbefore = startbefore + 1
         if startbefore < 0:
             startbefore = 0
             stopbefore = len(s) + 1
+        else:
+            stopbefore = startbefore + 1
     oldstate = engine.heap.branch()
     if not isinstance(sub, term.Var):
         s1 = helper.unwrap_atom(sub)



More information about the Pypy-commit mailing list