Commit Graph

2 Commits

Author SHA1 Message Date
Gabor Horvath d1abcf799e [analyzer] Improve pointer arithmetic checker.
This patch is intended to improve pointer arithmetic checker.
From now on it only warns when the pointer arithmetic is likely to cause an
error. For example when the pointer points to a single object, or an array of
derived types.

Differential Revision: http://reviews.llvm.org/D14203

llvm-svn: 261632
2016-02-23 12:34:39 +00:00
Anna Zaks bac964e14f [analyzer] Use a more generic MemRegion.getAsOffset to evaluate bin operators on MemRegions
In addition to enabling more code reuse, this suppresses some false positives by allowing us to
compare an element region to its base. See the ptr-arith.cpp test cases for an example.

llvm-svn: 182780
2013-05-28 17:31:43 +00:00