[llvm-commits] [llvm] r162309 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp

Richard Smith richard-llvm at metafoo.co.uk
Tue Aug 21 13:35:14 PDT 2012


Author: rsmith
Date: Tue Aug 21 15:35:14 2012
New Revision: 162309

URL: http://llvm.org/viewvc/llvm-project?rev=162309&view=rev
Log:
Don't bind a reference to a dereferenced null pointer (for return value of WeakVH::operator*).

Modified:
    llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=162309&r1=162308&r2=162309&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Aug 21 15:35:14 2012
@@ -738,7 +738,8 @@
   bool Changed = false;
 
   while (!DeadInsts.empty()) {
-    Instruction *I = dyn_cast_or_null<Instruction>(&*DeadInsts.pop_back_val());
+    Value *V = DeadInsts.pop_back_val();
+    Instruction *I = dyn_cast_or_null<Instruction>(V);
 
     if (I == 0 || !isInstructionTriviallyDead(I))
       continue;





More information about the llvm-commits mailing list