]> granicus.if.org Git - clang/commit
[analyzer] Anti-aliasing: different heap allocations do not alias
authorAnna Zaks <ganna@apple.com>
Thu, 7 Jun 2012 03:57:32 +0000 (03:57 +0000)
committerAnna Zaks <ganna@apple.com>
Thu, 7 Jun 2012 03:57:32 +0000 (03:57 +0000)
commite17fdb2d5dbf0ffefd417587003eebbe5baf5984
tree0cd9585d53661ebde4fa7f2f22a991802284b0cf
parent826eac59e4b107973ed1c5a761ad8785aa1bcde4
[analyzer] Anti-aliasing: different heap allocations do not alias

Add a concept of symbolic memory region belonging to heap memory space.
When comparing symbolic regions allocated on the heap, assume that they
do not alias.

Use symbolic heap region to suppress a common false positive pattern in
the malloc checker, in code that relies on malloc not returning the
memory aliased to other malloc allocations, stack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158136 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h
include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
lib/StaticAnalyzer/Core/MemRegion.cpp
lib/StaticAnalyzer/Core/SValBuilder.cpp
lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
test/Analysis/malloc.c