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
diff --git a/lib/Transforms/Scalar/PredicateSimplifier.cpp b/lib/Transforms/Scalar/PredicateSimplifier.cpp
index 8332f56..4bcc339 100644
--- a/lib/Transforms/Scalar/PredicateSimplifier.cpp
+++ b/lib/Transforms/Scalar/PredicateSimplifier.cpp
@@ -1311,7 +1311,7 @@
         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;
       }