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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231788 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Karthik Bhat
2015-03-10 14:32:02 +00:00
parent 57f42270e5
commit 36b589fd8a
2 changed files with 105 additions and 0 deletions

View File

@@ -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;