[pypy-svn] r78136 - pypy/trunk/pypy/translator/c

arigo at codespeak.net arigo at codespeak.net
Wed Oct 20 16:46:49 CEST 2010


Author: arigo
Date: Wed Oct 20 16:46:48 2010
New Revision: 78136

Modified:
   pypy/trunk/pypy/translator/c/funcgen.py
Log:
Fix.


Modified: pypy/trunk/pypy/translator/c/funcgen.py
==============================================================================
--- pypy/trunk/pypy/translator/c/funcgen.py	(original)
+++ pypy/trunk/pypy/translator/c/funcgen.py	Wed Oct 20 16:46:48 2010
@@ -445,8 +445,7 @@
             r = self.expr(v_result)
             line = '%s = %s' % (r, line)
         if targets:
-            for func in targets:
-                graph = getattr(func._obj, 'graph', None)
+            for graph in targets:
                 if getattr(graph, 'inhibit_tail_call', False):
                     line += '\nPYPY_INHIBIT_TAIL_CALL();'
                     break
@@ -454,8 +453,12 @@
 
     def OP_DIRECT_CALL(self, op):
         fn = op.args[0]
+        try:
+            targets = [fn.value._obj.graph]
+        except AttributeError:
+            targets = None
         return self.generic_call(fn.concretetype, self.expr(fn),
-                                 op.args[1:], op.result, [fn.value])
+                                 op.args[1:], op.result, targets)
 
     def OP_INDIRECT_CALL(self, op):
         fn = op.args[0]



More information about the Pypy-commit mailing list