aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Tooling/CompilationDatabaseTest.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
commit968c60a554afc8d8e044f6f7d3a5a550274632bb (patch)
treeb2588ce1420cac7a161c11ee3bec2bfde7ecc85b /clang/unittests/Tooling/CompilationDatabaseTest.cpp
parent90ee2f1fd7d52433ffee6a0089c19588aea308d7 (diff)
downloadllvm-968c60a554afc8d8e044f6f7d3a5a550274632bb.zip
llvm-968c60a554afc8d8e044f6f7d3a5a550274632bb.tar.gz
llvm-968c60a554afc8d8e044f6f7d3a5a550274632bb.tar.bz2
[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; } llvm-svn: 194953
Diffstat (limited to 'clang/unittests/Tooling/CompilationDatabaseTest.cpp')
0 files changed, 0 insertions, 0 deletions