[pypy-svn] r13697 - pypy/dist/pypy/rpython

arigo at codespeak.net arigo at codespeak.net
Thu Jun 23 12:00:30 CEST 2005


Author: arigo
Date: Thu Jun 23 12:00:28 2005
New Revision: 13697

Modified:
   pypy/dist/pypy/rpython/normalizecalls.py
   pypy/dist/pypy/rpython/rpbc.py
Log:
Normalize calls for return values too.


Modified: pypy/dist/pypy/rpython/normalizecalls.py
==============================================================================
--- pypy/dist/pypy/rpython/normalizecalls.py	(original)
+++ pypy/dist/pypy/rpython/normalizecalls.py	Thu Jun 23 12:00:28 2005
@@ -115,6 +115,9 @@
                     args_s.append(bindings[j])
                 s_value = unionof(*args_s)
                 generalizedargs.append(s_value)
+            result_s = [annotator.binding(graph.getreturnvar())
+                        for graph in graph_bindings]
+            generalizedresult = unionof(*result_s)
 
             for func in functions:
                 graph = annotator.translator.getflowgraph(func)
@@ -158,7 +161,8 @@
                     checkgraph(graph)
                     annotator.annotated[newblock] = annotator.annotated[oldblock]
                 graph.normalized_for_calls = True
-                # XXX convert the return value too
+                # convert the return value too
+                annotator.setbinding(graph.getreturnvar(), generalizedresult)
 
 
 def perform_normalizations(annotator):

Modified: pypy/dist/pypy/rpython/rpbc.py
==============================================================================
--- pypy/dist/pypy/rpython/rpbc.py	(original)
+++ pypy/dist/pypy/rpython/rpbc.py	Thu Jun 23 12:00:28 2005
@@ -299,7 +299,8 @@
         if self.lowleveltype == Void:
             assert len(self.function_signatures) == 1
             vlist[0] = hop.inputconst(typeOf(f), f)
-        return hop.genop('direct_call', vlist, resulttype = rresult)
+        v = hop.genop('direct_call', vlist, resulttype = rresult)
+        return hop.llops.convertvar(v, rresult, hop.r_result)
 
     def rtype_call_args(self, hop):
         f, rinputs, rresult = self.function_signatures.itervalues().next()



More information about the Pypy-commit mailing list