diff options
author | Anna Zaks <ganna@apple.com> | 2012-02-16 03:40:57 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-02-16 03:40:57 +0000 |
commit | d32ead82d93f38ec11ba78a6c95bc41db377c99e (patch) | |
tree | dd4a7cc03e45313820405242604f58a44b31205d /clang/test/Analysis/malloc-annotations.c | |
parent | 17100bad0ac1b25e9f4f2dd8ef6d5629ad1364d6 (diff) | |
download | bcm5719-llvm-d32ead82d93f38ec11ba78a6c95bc41db377c99e.tar.gz bcm5719-llvm-d32ead82d93f38ec11ba78a6c95bc41db377c99e.zip |
[analyzer] Malloc Checker: Give up when a pointer escapes into a struct.
We are not properly handling the memory regions that escape into struct
fields, which led to a bunch of false positives. Be conservative here
and give up when a pointer escapes into a struct.
llvm-svn: 150658
Diffstat (limited to 'clang/test/Analysis/malloc-annotations.c')
-rw-r--r-- | clang/test/Analysis/malloc-annotations.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/test/Analysis/malloc-annotations.c b/clang/test/Analysis/malloc-annotations.c index 98dc2e7269b..4ee60ae14fb 100644 --- a/clang/test/Analysis/malloc-annotations.c +++ b/clang/test/Analysis/malloc-annotations.c @@ -68,9 +68,10 @@ 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); // expected-warning{{Allocated memory never released. Potential memory leak.}} + mystuff.somefield = my_malloc(12); // false negative } // Test that we can pass out allocated memory via pointer-to-pointer. |