[pypy-svn] r13008 - pypy/dist/pypy/annotation

pedronis at codespeak.net pedronis at codespeak.net
Thu Jun 2 17:32:07 CEST 2005


Author: pedronis
Date: Thu Jun  2 17:32:07 2005
New Revision: 13008

Modified:
   pypy/dist/pypy/annotation/bookkeeper.py
Log:
ignore None when computing the pbc maximal access sets, note that whether None reach a PBC
access site should be recorded in the annotation of the site itself



Modified: pypy/dist/pypy/annotation/bookkeeper.py
==============================================================================
--- pypy/dist/pypy/annotation/bookkeeper.py	(original)
+++ pypy/dist/pypy/annotation/bookkeeper.py	Thu Jun  2 17:32:07 2005
@@ -255,21 +255,32 @@
 
         access_sets = self.pbc_maximal_access_sets
         objects = pbc.prebuiltinstances.keys()
-
-        change, rep, access = access_sets.find(objects[0])
+        access = None
+        first = None
+        change = False
+        
         for obj in objects:
-            change1, rep, access = access_sets.union(rep, obj)
-            change = change or change1
-
-        access.attrs[attr] = True
-        position = self.position_key
-        access.read_locations[position] = True
+            if obj is not None:
+                first = obj
+                break
+
+        if first is not None:
+            change, rep, access = access_sets.find(objects[0])
+            for obj in objects:
+                if obj is not None:
+                    change1, rep, access = access_sets.union(rep, obj)
+                    change = change or change1
+
+            access.attrs[attr] = True
+            position = self.position_key
+            access.read_locations[position] = True
 
         actuals = []
 
-        for c in access.objects:
-            if hasattr(c, attr):
-                actuals.append(self.immutablevalue(getattr(c, attr)))
+        if access:
+            for c in access.objects:
+                if hasattr(c, attr):
+                    actuals.append(self.immutablevalue(getattr(c, attr)))
 
         if change:
             for position in access.read_locations:



More information about the Pypy-commit mailing list