[PATCH] Fix a crash in Dependency Analysis

Karthik Bhat kv.bhat at samsung.com
Wed Mar 4 07:49:57 PST 2015


Hi hfinkel, dblaikie, spop,

Hi All,
This crash is observed in Polybench/linear-algebra/solvers/dynprog in llvm lnt. The crash seems to be because of invalid memory access. 

Memory corruption occurs when we access elements of Result->DV[SJ - 1]. This is because the ConstrainedLevels is based on Max Nesting Level and DVEntry in Result is based on Common Nesting levels between the 2 memory instructions which are  being analyzed. 
Memory corruption occurs when MaxLevels>CommonLevels and we access Result->DV[SJ - 1] to update direction based on constraints.
This patch adds a check to avoid memory corruption and conservatively exits the loop updating the direction when the above mentioned scenario occurs.

Please let me know your inputs on this patch.

Thanks and Regards
Karthik Bhat

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8059

Files:
  lib/Analysis/DependenceAnalysis.cpp
  test/Analysis/DependenceAnalysis/Constraints.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8059.21201.patch
Type: text/x-patch
Size: 6002 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150304/fad81331/attachment.bin>


More information about the llvm-commits mailing list