summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-08-21 20:35:14 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-08-21 20:35:14 +0000
commitad9c8e839ee78e77416489a0ecafb0e90f6968eb (patch)
treee217d356633393c3a64a4c92fc7971b6a8d484a1 /llvm/lib
parent393fbf6c5343954a542c33b49a98aaddde9a4cba (diff)
downloadbcm5719-llvm-ad9c8e839ee78e77416489a0ecafb0e90f6968eb.tar.gz
bcm5719-llvm-ad9c8e839ee78e77416489a0ecafb0e90f6968eb.zip
Don't bind a reference to a dereferenced null pointer (for return value of WeakVH::operator*).
llvm-svn: 162309
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index b14a713ce47..0ae7a5151e7 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud