]> granicus.if.org Git - clang/commit
[analyzer] Malloc: Utter the name of the leaked variable.
authorAnna Zaks <ganna@apple.com>
Wed, 21 Mar 2012 19:45:08 +0000 (19:45 +0000)
committerAnna Zaks <ganna@apple.com>
Wed, 21 Mar 2012 19:45:08 +0000 (19:45 +0000)
commit3d7c44e01d568e5d5c0fac9c6ccb3f080157ba19
treeff9816c4eeae7a37e1563efcf54edc3680dba169
parent27b867ea1c9cb4b40f9b817c303d6df3ee753da9
[analyzer] Malloc: Utter the name of the leaked variable.
Specifically, we use the last store of the leaked symbol in the leak diagnostic.
(No support for struct fields since the malloc checker doesn't track those
yet.)

+ Infrastructure to track the regions used in store evaluations.
This approach is more precise than iterating the store to
obtain the region bound to the symbol, which is used in RetainCount
checker. The region corresponds to what is uttered in the code in the
last store and we do not rely on the store implementation to support
this functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153212 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/clang/Analysis/ProgramPoint.h
include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h
lib/Analysis/ProgramPoint.cpp
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp
lib/StaticAnalyzer/Core/MemRegion.cpp
test/Analysis/malloc-annotations.c
test/Analysis/malloc-interprocedural.c
test/Analysis/malloc-plist.c
test/Analysis/malloc.c