diff options
author | Anna Zaks <ganna@apple.com> | 2013-03-15 23:34:29 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2013-03-15 23:34:29 +0000 |
commit | bda130f02af174495debe9a26101c9fe1a4a090b (patch) | |
tree | 784c23b72759a1865efdb4765936d5bb45b5c267 /clang/test/Analysis/malloc.c | |
parent | e0f1a0f0d84932c9764ec5a5a3d953adc51cbe7d (diff) | |
download | bcm5719-llvm-bda130f02af174495debe9a26101c9fe1a4a090b.tar.gz bcm5719-llvm-bda130f02af174495debe9a26101c9fe1a4a090b.zip |
[analyzer] Use isLiveRegion to determine when SymbolRegionValue is dead.
Fixes a FIXME, improves dead symbol collection, suppresses a false positive,
which resulted from reusing the same symbol twice for simulation of 2 calls to the same function.
Fixing this lead to 2 possible false negatives in CString checker. Since the checker is still alpha and
the solution will not require revert of this commit, move the tests to a FIXME section.
llvm-svn: 177206
Diffstat (limited to 'clang/test/Analysis/malloc.c')
-rw-r--r-- | clang/test/Analysis/malloc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Analysis/malloc.c b/clang/test/Analysis/malloc.c index 29f5aa69ca5..e8b4ad3b4df 100644 --- a/clang/test/Analysis/malloc.c +++ b/clang/test/Analysis/malloc.c @@ -1191,3 +1191,14 @@ void testOffsetPassedAsConst() { free(string); // expected-warning {{Argument to free() is offset by 1 byte from the start of memory allocated by malloc()}} } +char **_vectorSegments; +int _nVectorSegments; + +void poolFreeC(void* s) { + free(s); // no-warning +} +void freeMemory() { + while (_nVectorSegments) { + poolFreeC(_vectorSegments[_nVectorSegments++]); + } +} |