From: Richard Smith Date: Tue, 21 Aug 2012 20:35:14 +0000 (+0000) Subject: Don't bind a reference to a dereferenced null pointer (for return value of WeakVH... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=875cc5d629697c16fd24662f7cce21766c3d2e4e;p=oota-llvm.git Don't bind a reference to a dereferenced null pointer (for return value of WeakVH::operator*). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162309 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index b14a713ce47..0ae7a5151e7 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -738,7 +738,8 @@ DeleteTriviallyDeadInstructions(SmallVectorImpl &DeadInsts) { bool Changed = false; while (!DeadInsts.empty()) { - Instruction *I = dyn_cast_or_null(&*DeadInsts.pop_back_val()); + Value *V = DeadInsts.pop_back_val(); + Instruction *I = dyn_cast_or_null(V); if (I == 0 || !isInstructionTriviallyDead(I)) continue;