diff options
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 661a7ad6d8..a60b871937 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -255,8 +255,11 @@ void SelectionDAGLegalize::LegalizeDAG() { static SDNode *FindCallEndFromCallStart(SDNode *Node, int depth = 0) { if (Node->getOpcode() == ISD::CALLSEQ_START) depth++; - if ((Node->getOpcode() == ISD::CALLSEQ_END) && (depth == 1)) - return Node; + else if (Node->getOpcode() == ISD::CALLSEQ_END) { + depth--; + if (depth == 0) + return Node; + } if (Node->use_empty()) return 0; // No CallSeqEnd |