summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DependenceAnalysis.cpp
diff options
context:
space:
mode:
authorKarthik Bhat <kv.bhat@samsung.com>2015-03-10 14:32:02 +0000
committerKarthik Bhat <kv.bhat@samsung.com>2015-03-10 14:32:02 +0000
commit8d7f7eda1452b2d9c391aa096ae1bde4e15e8514 (patch)
tree87566a48f0d614caa2eb4adf267acf4b166ee09c /llvm/lib/Analysis/DependenceAnalysis.cpp
parent496059c8c9c0ab6f3c2f5c97fe40dfbde2abd575 (diff)
downloadbcm5719-llvm-8d7f7eda1452b2d9c391aa096ae1bde4e15e8514.tar.gz
bcm5719-llvm-8d7f7eda1452b2d9c391aa096ae1bde4e15e8514.zip
Fix a memory corruption in Dependency Analysis.
This crash occurs due to memory corruption when trying to update dependency direction based on Constraints. This crash was observed during lnt regression of Polybench benchmark test case dynprog. Review: http://reviews.llvm.org/D8059 llvm-svn: 231788
Diffstat (limited to 'llvm/lib/Analysis/DependenceAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/DependenceAnalysis.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp
index 3dcfcb839ad..3374b48c141 100644
--- a/llvm/lib/Analysis/DependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/DependenceAnalysis.cpp
@@ -3651,6 +3651,8 @@ DependenceAnalysis::depends(Instruction *Src, Instruction *Dst,
DEBUG(dbgs() << " updating\n");
for (int SJ = ConstrainedLevels.find_first(); SJ >= 0;
SJ = ConstrainedLevels.find_next(SJ)) {
+ if (SJ > (int)CommonLevels)
+ break;
updateDirection(Result.DV[SJ - 1], Constraints[SJ]);
if (Result.DV[SJ - 1].Direction == Dependence::DVEntry::NONE)
return nullptr;
OpenPOWER on IntegriCloud