Antonio Cuni  committed 67fec99

fix an obscure case which seems to be produced only with ootype translation. I didn't manage to write a test for it :-(

  • Participants
  • Parent commits ecc883f
  • Branches ootype-virtualrefs

Comments (0)

Files changed (1)

File pypy/translator/backendopt/

             # False link
             checkvar = [var for var in current.operations[-1].args
                            if isinstance(var, Variable)][0]
+            resvar = current.operations[-1].result
             case = [var for var in current.operations[-1].args
                        if isinstance(var, Constant)][0]
-            chain.append((current, case))
             falseexit = current.exits[0]
             assert not falseexit.exitcase
             trueexit = current.exits[1]
             targetblock =
+            # if the result of the check is also passed through the link, we
+            # cannot construct the chain
+            if resvar in falseexit.args or resvar in trueexit.args:
+                break
+            chain.append((current, case))
             if len(entrymap[targetblock]) != 1:
             if checkvar not in falseexit.args: