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 | d2eb0c9653fc4f184586f4bef6482da56d3e1f36 (patch) | |
tree | cdac0a48aa92f3d51b652712bcb9ec1160067d92 /llvm/lib/VMCore/Dominators.cpp | |
parent | 0e8f85f87e9388179f9708e8a9898e48632f1bab (diff) | |
download | bcm5719-llvm-d2eb0c9653fc4f184586f4bef6482da56d3e1f36.tar.gz bcm5719-llvm-d2eb0c9653fc4f184586f4bef6482da56d3e1f36.zip |
Fix an iterator invalidation bug I induced.
llvm-svn: 40830
Diffstat (limited to 'llvm/lib/VMCore/Dominators.cpp')
-rw-r--r-- | llvm/lib/VMCore/Dominators.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/Dominators.cpp b/llvm/lib/VMCore/Dominators.cpp index 7d0fbaa29aa..8981ee70b09 100644 --- a/llvm/lib/VMCore/Dominators.cpp +++ b/llvm/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, |