summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/malloc-annotations.c
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-06-20 20:57:46 +0000
committerAnna Zaks <ganna@apple.com>2012-06-20 20:57:46 +0000
commit9050ffd57c9f88a9a660f9605659fa9ee40c9281 (patch)
treeae6d65956e2074c689d3d227d85e6023637860ad /clang/test/Analysis/malloc-annotations.c
parent51b7357159d7d28e01e341b5192d8d09abd7a7ad (diff)
downloadbcm5719-llvm-9050ffd57c9f88a9a660f9605659fa9ee40c9281.tar.gz
bcm5719-llvm-9050ffd57c9f88a9a660f9605659fa9ee40c9281.zip
[analyzer] Malloc: cleanup, disallow free on relinquished memory.
This commits sets the grounds for more aggressive use after free checking. We will use the Relinquished sate to denote that someone else is now responsible for releasing the memory. llvm-svn: 158850
Diffstat (limited to 'clang/test/Analysis/malloc-annotations.c')
-rw-r--r--clang/test/Analysis/malloc-annotations.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/Analysis/malloc-annotations.c b/clang/test/Analysis/malloc-annotations.c
index a0c145279d9..15ce62d9a5e 100644
--- a/clang/test/Analysis/malloc-annotations.c
+++ b/clang/test/Analysis/malloc-annotations.c
@@ -123,12 +123,12 @@ void af2e() {
free(p); // no-warning
}
-// This case would inflict a double-free elsewhere.
-// However, this case is considered an analyzer bug since it causes false-positives.
+// This case inflicts a possible double-free.
+// TODO: Better error message.
void af3() {
int *p = my_malloc(12);
my_hold(p);
- free(p); // no-warning
+ free(p); // expected-warning{{Attempt to free released memory}}
}
int * af4() {
OpenPOWER on IntegriCloud