diff options
Diffstat (limited to 'lib/Analysis/InstructionSimplify.cpp')
-rw-r--r-- | lib/Analysis/InstructionSimplify.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp index dbefc2dedb..0efe183a99 100644 --- a/lib/Analysis/InstructionSimplify.cpp +++ b/lib/Analysis/InstructionSimplify.cpp @@ -443,7 +443,9 @@ void llvm::ReplaceAndSimplifyAllUses(Instruction *From, Value *To, // FromHandle - This keeps a weakvh on the from value so that we can know if // it gets deleted out from under us in a recursive simplification. WeakVH FromHandle(From); - + // Double-check that To isn't deleted. + AssertingVH<> CheckedTo = To; + while (!From->use_empty()) { // Update the instruction to use the new value. Use &U = From->use_begin().getUse(); |