diff options
author | Chris Lattner <sabre@nondot.org> | 2007-08-05 00:24:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-08-05 00:24:30 +0000 |
commit | 8be9adb22058a5033b0b30f6ae3eeb32eea13648 (patch) | |
tree | 5c5a936ad45f9a5281fa52a50490a07523b061d3 | |
parent | 33607b07a8b62745f687ca849e7e796ad76e1baf (diff) | |
download | external_llvm-8be9adb22058a5033b0b30f6ae3eeb32eea13648.zip external_llvm-8be9adb22058a5033b0b30f6ae3eeb32eea13648.tar.gz external_llvm-8be9adb22058a5033b0b30f6ae3eeb32eea13648.tar.bz2 |
Fix an iterator invalidation bug I induced.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40830 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Analysis/PostDominators.cpp | 3 | ||||
-rw-r--r-- | lib/VMCore/Dominators.cpp | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/Analysis/PostDominators.cpp b/lib/Analysis/PostDominators.cpp index d2892de..4622441 100644 --- a/lib/Analysis/PostDominators.cpp +++ b/lib/Analysis/PostDominators.cpp @@ -217,8 +217,7 @@ DomTreeNode *PostDominatorTree::getNodeForBlock(BasicBlock *BB) { // Add a new tree node for this BasicBlock, and link it as a child of // IDomNode DomTreeNode *C = new DomTreeNode(BB, IPDomNode); - DomTreeNodes[BB] = C; - return BBNode = IPDomNode->addChild(C); + return DomTreeNodes[BB] = IPDomNode->addChild(C); } //===----------------------------------------------------------------------===// diff --git a/lib/VMCore/Dominators.cpp b/lib/VMCore/Dominators.cpp index 7d0fbaa..8981ee7 100644 --- a/lib/VMCore/Dominators.cpp +++ b/lib/VMCore/Dominators.cpp @@ -120,7 +120,8 @@ void DominatorTree::splitBlock(BasicBlock *NewBB) { } - // Find NewBB's immediate dominator and create new dominator tree node for NewBB. + // Find NewBB's immediate dominator and create new dominator tree node for + // NewBB. BasicBlock *NewBBIDom = 0; unsigned i = 0; for (i = 0; i < PredBlocks.size(); ++i) @@ -552,8 +553,7 @@ DomTreeNode *DominatorTree::getNodeForBlock(BasicBlock *BB) { // Add a new tree node for this BasicBlock, and link it as a child of // IDomNode DomTreeNode *C = new DomTreeNode(BB, IDomNode); - DomTreeNodes[BB] = C; - return BBNode = IDomNode->addChild(C); + return DomTreeNodes[BB] = IDomNode->addChild(C); } static std::ostream &operator<<(std::ostream &o, |