Commits

Maciej Fijalkowski committed 376eb89 Merge

merge

Comments (0)

Files changed (1)

rpython/rtyper/rtyper.py

                 callee_graph = graph,
                 position_tag = object())
 
-    def convertvar(self, v, r_from, r_to):
-        assert isinstance(v, (Variable, Constant))
+    def convertvar(self, orig_v, r_from, r_to):
+        assert isinstance(orig_v, (Variable, Constant))
         if r_from != r_to:
-            v = pair(r_from, r_to).convert_from_to(v, self)
+            v = pair(r_from, r_to).convert_from_to(orig_v, self)
             if v is NotImplemented:
                 raise TyperError("don't know how to convert from %r to %r" %
                                  (r_from, r_to))
                 raise TyperError("bug in conversion from %r to %r: "
                                  "returned a %r" % (r_from, r_to,
                                                     v.concretetype))
+        else:
+            v = orig_v
         return v
 
     def genop(self, opname, args_v, resulttype=None):