diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-21 20:35:14 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-21 20:35:14 +0000 |
commit | 875cc5d629697c16fd24662f7cce21766c3d2e4e (patch) | |
tree | 6990015161ac65fc403028c5a4556b2c1c734b7f /lib/Transforms/Scalar/LoopStrengthReduce.cpp | |
parent | b4fdadef51ed254d9282356463c6b11ff8a102df (diff) | |
download | llvm-875cc5d629697c16fd24662f7cce21766c3d2e4e.tar.gz llvm-875cc5d629697c16fd24662f7cce21766c3d2e4e.tar.bz2 llvm-875cc5d629697c16fd24662f7cce21766c3d2e4e.tar.xz |
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
Diffstat (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index b14a713ce4..0ae7a5151e 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -738,7 +738,8 @@ DeleteTriviallyDeadInstructions(SmallVectorImpl<WeakVH> &DeadInsts) { 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; |