[pypy-svn] r25329 - pypy/dist/pypy/translator/c

tismer at codespeak.net tismer at codespeak.net
Tue Apr 4 23:23:24 CEST 2006


Author: tismer
Date: Tue Apr  4 23:23:22 2006
New Revision: 25329

Modified:
   pypy/dist/pypy/translator/c/stackless.py
Log:
do not rely on graphs always having a 'func' attribute

Modified: pypy/dist/pypy/translator/c/stackless.py
==============================================================================
--- pypy/dist/pypy/translator/c/stackless.py	(original)
+++ pypy/dist/pypy/translator/c/stackless.py	Tue Apr  4 23:23:22 2006
@@ -69,7 +69,9 @@
         for caller, callee in translator.callgraph.values():
             # ignore calls issued suggested_primitives -- they are not
             # compiled in, and they typically contain pseudo-recursions
-            if not getattr(caller.func, 'suggested_primitive', False): 
+            func = getattr(caller, 'func')
+            # there are graphs without funcs
+            if not getattr(func, 'suggested_primitive', False): 
                 callers[caller].append(callee)
         # check all callees if they can reach unwind
         can_reach_unwind = self.can_reach_unwind
@@ -88,7 +90,8 @@
                 if ret:
                     break
             else:
-                ret = graph.func in self.stackless_roots
+                func = getattr(graph, 'func')
+                ret = func in self.stackless_roots
             del pending[graph]
             can_reach_unwind[graph] = ret
             return ret



More information about the Pypy-commit mailing list