summaryrefslogtreecommitdiff
path: root/lib/Tooling/CompilationDatabase.cpp
diff options
context:
space:
mode:
authorAnton Yartsev <anton.yartsev@gmail.com>2013-11-17 09:18:48 +0000
committerAnton Yartsev <anton.yartsev@gmail.com>2013-11-17 09:18:48 +0000
commitb7a747b0c271faeeb8d0f886f0e691eb25f637d9 (patch)
tree468dedc21bc497c62c69e41a3b367e15cc8c644f /lib/Tooling/CompilationDatabase.cpp
parent99cbf42292c59c6833d6ec4e69235ac5309e20d0 (diff)
downloadclang-b7a747b0c271faeeb8d0f886f0e691eb25f637d9.tar.gz
clang-b7a747b0c271faeeb8d0f886f0e691eb25f637d9.tar.bz2
clang-b7a747b0c271faeeb8d0f886f0e691eb25f637d9.tar.xz
[analyzer] Better modeling of memcpy by the CStringChecker (PR16731).
New rules of invalidation/escape of the source buffer of memcpy: the source buffer contents is invalidated and escape while the source buffer region itself is neither invalidated, nor escape. In the current modeling of memcpy the information about allocation state of regions, accessible through the source buffer, is not copied to the destination buffer and we can not track the allocation state of those regions anymore. So we invalidate/escape the source buffer indirect regions in anticipation of their being invalidated for real later. This eliminates false-positive leaks reported by the unix.Malloc and alpha.cplusplus.NewDeleteLeaks checkers for the cases like char *f() { void *x = malloc(47); char *a; memcpy(&a, &x, sizeof a); return a; } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Tooling/CompilationDatabase.cpp')
0 files changed, 0 insertions, 0 deletions