[pypy-svn] r66448 - pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/test

arigo at codespeak.net arigo at codespeak.net
Mon Jul 20 18:24:08 CEST 2009


Author: arigo
Date: Mon Jul 20 18:24:08 2009
New Revision: 66448

Modified:
   pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/test/oparser.py
Log:
When parsing a variable called e.g. 'i5', make sure that
automatically-numbered variables created afterwards don't
also get the name 'i5'.


Modified: pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/test/oparser.py
==============================================================================
--- pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/test/oparser.py	(original)
+++ pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/test/oparser.py	Mon Jul 20 18:24:08 2009
@@ -64,9 +64,11 @@
         if elem.startswith('i'):
             # integer
             box = BoxInt()
+            _box_counter_more_than(elem[1:])
         elif elem.startswith('p'):
             # pointer
             box = BoxPtr()
+            _box_counter_more_than(elem[1:])
         else:
             for prefix, boxclass in self.boxkinds.iteritems():
                 if elem.startswith(prefix):
@@ -213,3 +215,7 @@
 def parse(descr, cpu=None, namespace={}, type_system='lltype',
           boxkinds=None):
     return OpParser(descr, cpu, namespace, type_system, boxkinds).parse()
+
+def _box_counter_more_than(s):
+    if s.isdigit():
+        Box._counter = max(Box._counter, int(s)+1)



More information about the Pypy-commit mailing list