Fix a problem that nate reduced for me.
[oota-llvm.git] / lib / CodeGen / SelectionDAG / LegalizeDAG.cpp
index f5d6fd6120154e92ed235e66912b87d5ba00848a..793037930c0159f80c2cd75ff0f68cf86eec9dc2 100644 (file)
@@ -2009,7 +2009,8 @@ static SDNode *FindCallSeqEnd(SDNode *Node) {
     SDNode *User = *UI;
     for (unsigned i = 0, e = User->getNumOperands(); i != e; ++i)
       if (User->getOperand(i) == TheChain)
-        return FindCallSeqEnd(User);
+        if (SDNode *Result = FindCallSeqEnd(User))
+          return Result;
   }
   assert(0 && "Unreachable");
   abort();