[pypy-svn] r28475 - pypy/dist/pypy/translator/cli

antocuni at codespeak.net antocuni at codespeak.net
Wed Jun 7 19:18:48 CEST 2006


Author: antocuni
Date: Wed Jun  7 19:18:47 2006
New Revision: 28475

Modified:
   pypy/dist/pypy/translator/cli/database.py
Log:
bugfix.



Modified: pypy/dist/pypy/translator/cli/database.py
==============================================================================
--- pypy/dist/pypy/translator/cli/database.py	(original)
+++ pypy/dist/pypy/translator/cli/database.py	Wed Jun  7 19:18:47 2006
@@ -28,6 +28,11 @@
         self.consts = {}  # value --> const_name
         self.delegates = {} # StaticMethod --> type_name
         self.const_names = set()
+        self.name_count = 0
+
+    def next_count(self):
+        self.name_count += 1
+        return self.name_count
 
     def pending_function(self, graph):
         self.pending_node(self.function_class(self, graph))
@@ -65,7 +70,7 @@
         except KeyError:
             name = const.get_name()
             if name in self.const_names:
-                name += '__%d' % len(self.consts)
+                name += '__%d' % self.next_count()
             self.consts[const] = name
             self.const_names.add(name)
 



More information about the Pypy-commit mailing list