diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-28 05:28:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-28 05:28:31 +0000 |
commit | e01f7e33ac24e040cd4c61874299a7cc33c3b8f4 (patch) | |
tree | e4dccc5ccae1ad9d0717a0721c939137d1c25913 /llvm/lib/CodeGen/SelectionDAG | |
parent | a520b166dc7976048713f708438b77ddfae653b4 (diff) | |
download | bcm5719-llvm-e01f7e33ac24e040cd4c61874299a7cc33c3b8f4.tar.gz bcm5719-llvm-e01f7e33ac24e040cd4c61874299a7cc33c3b8f4.zip |
don't add nodes to the now-dead nodes list multiple times, this
can cause a crash on crazy situations in msp430 when morph-node-to
is disabled.
llvm-svn: 99739
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 600557eddfd..3981826f59a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1592,8 +1592,9 @@ UpdateChainsAndFlags(SDNode *NodeToMatch, SDValue InputChain, assert(ChainVal.getValueType() == MVT::Other && "Not a chain?"); CurDAG->ReplaceAllUsesOfValueWith(ChainVal, InputChain, &ISU); - // If the node became dead, delete it. - if (ChainNode->use_empty()) + // If the node became dead and we haven't already seen it, delete it. + if (ChainNode->use_empty() && + !std::count(NowDeadNodes.begin(), NowDeadNodes.end(), ChainNode)) NowDeadNodes.push_back(ChainNode); } } |