Don't try to get the context from an erased Instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79134 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2009-08-15 21:07:49 +00:00
parent bc037cfcde
commit a130a511f4

View File

@ -1311,7 +1311,7 @@ namespace {
TerminatorInst *TI = BB->getTerminator();
TI->replaceAllUsesWith(UndefValue::get(TI->getType()));
TI->eraseFromParent();
new UnreachableInst(TI->getContext(), BB);
new UnreachableInst(BB->getContext(), BB);
++NumBlocks;
modified = true;
}