diff options
author | Anna Zaks <ganna@apple.com> | 2012-03-22 00:57:20 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-03-22 00:57:20 +0000 |
commit | 9fe8098e29666cf9ef0c9ce38890284f44074958 (patch) | |
tree | bbe28ebb333d547a1de7f95f3b6b05586e4f91bf /clang/test/Analysis/malloc.mm | |
parent | f8712de58cb966291018a55717ea500924879b23 (diff) | |
download | bcm5719-llvm-9fe8098e29666cf9ef0c9ce38890284f44074958.tar.gz bcm5719-llvm-9fe8098e29666cf9ef0c9ce38890284f44074958.zip |
[analyzer] Malloc: drop symbols captured by blocks.
llvm-svn: 153232
Diffstat (limited to 'clang/test/Analysis/malloc.mm')
-rw-r--r-- | clang/test/Analysis/malloc.mm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/test/Analysis/malloc.mm b/clang/test/Analysis/malloc.mm index 31db5ced15a..4cb2cfa328a 100644 --- a/clang/test/Analysis/malloc.mm +++ b/clang/test/Analysis/malloc.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -verify %s +// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -verify -fblocks %s #include "system-header-simulator-objc.h" typedef __typeof(sizeof(int)) size_t; @@ -97,3 +97,12 @@ NSData *radar10976702() { return [NSData dataWithBytesNoCopy:bytes length:10]; // no-warning } +void testBlocks() { + int *x= (int*)malloc(sizeof(int)); + int (^myBlock)(int) = ^(int num) { + free(x); + return num; + }; + myBlock(3); +} + |