RegionInfo: Do not crash if unreachable block is found

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181025 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Tobias Grosser
2013-05-03 15:48:34 +00:00
parent e050e59a47
commit 333403abbd
2 changed files with 31 additions and 1 deletions

View File

@@ -114,7 +114,8 @@ void Region::replaceExitRecursive(BasicBlock *NewExit) {
bool Region::contains(const BasicBlock *B) const {
BasicBlock *BB = const_cast<BasicBlock*>(B);
assert(DT->getNode(BB) && "BB not part of the dominance tree");
if (!DT->getNode(BB))
return false;
BasicBlock *entry = getEntry(), *exit = getExit();