diff options
author | Dan Gohman <gohman@apple.com> | 2012-05-09 23:08:33 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2012-05-09 23:08:33 +0000 |
commit | f8b19d09bab90815fc87c0f698f161ae16a2b6fb (patch) | |
tree | b82cd30eef9efa99923aa7ebf0aa49c2fe33e68b /llvm/lib/Transforms | |
parent | 9b41e5dbc6314e3163fe3d7786ba8688682a9fdd (diff) | |
download | bcm5719-llvm-f8b19d09bab90815fc87c0f698f161ae16a2b6fb.tar.gz bcm5719-llvm-f8b19d09bab90815fc87c0f698f161ae16a2b6fb.zip |
Fix the objc_storeStrong recognizer to stop before walking off the
end of a basic block if there's no store.
llvm-svn: 156520
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/ObjCARC.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/ObjCARC.cpp b/llvm/lib/Transforms/Scalar/ObjCARC.cpp index 5d6e1a7d9f5..ce4a195d95b 100644 --- a/llvm/lib/Transforms/Scalar/ObjCARC.cpp +++ b/llvm/lib/Transforms/Scalar/ObjCARC.cpp @@ -3902,12 +3902,15 @@ void ObjCARCContract::ContractRelease(Instruction *Release, if (Load->getParent() != BB) return; // Walk down to find the store and the release, which may be in either order. - BasicBlock::iterator I = Load; + BasicBlock::iterator I = Load, End = BB->end(); ++I; AliasAnalysis::Location Loc = AA->getLocation(Load); StoreInst *Store = 0; bool SawRelease = false; for (; !Store || !SawRelease; ++I) { + if (I == End) + return; + Instruction *Inst = I; if (Inst == Release) { SawRelease = true; |