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 | a31965301da89a7d0c829bded72c6b0da0303c54 (patch) | |
tree | 5c5a936ad45f9a5281fa52a50490a07523b061d3 /lib/VMCore | |
parent | 2f0d1ea864ff0fe59c5a2b35390a82fad2865b61 (diff) | |
download | external_llvm-a31965301da89a7d0c829bded72c6b0da0303c54.zip external_llvm-a31965301da89a7d0c829bded72c6b0da0303c54.tar.gz external_llvm-a31965301da89a7d0c829bded72c6b0da0303c54.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
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Dominators.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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, |