diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-08-08 18:23:31 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-08-08 18:23:31 +0000 |
commit | 0d53ab4024488d0c6cd283992be3fd4b67099bd3 (patch) | |
tree | 2d6a8de8cff82ab71bdcd98a0c649b77fecebffb /test/Analysis/malloc-annotations.c | |
parent | e0d24eb1060a213ec9820dc02c45f26b2d5b348b (diff) |
[analyzer] Track malloc'd regions stored in structs.
The main blocker on this (besides the previous commit) was that
ScanReachableSymbols was not looking through LazyCompoundVals.
Once that was fixed, it's easy enough to clear out malloc data on return,
just like we do when we bind to a global region.
<rdar://problem/10872635>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161511 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/malloc-annotations.c')
-rw-r--r-- | test/Analysis/malloc-annotations.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/test/Analysis/malloc-annotations.c b/test/Analysis/malloc-annotations.c index 089e53132d..1dc0f7837b 100644 --- a/test/Analysis/malloc-annotations.c +++ b/test/Analysis/malloc-annotations.c @@ -70,10 +70,9 @@ void af1_c() { myglobalpointer = my_malloc(12); // no-warning } -// TODO: We will be able to handle this after we add support for tracking allocations stored in struct fields. void af1_d() { struct stuff mystuff; - mystuff.somefield = my_malloc(12); // false negative + mystuff.somefield = my_malloc(12); // expected-warning{{Memory is never released; potential leak}} } // Test that we can pass out allocated memory via pointer-to-pointer. |