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 | f5aa3f5e58356d0bea823fe75dd7bf6aea6f47f4 (patch) | |
tree | 9741fcc751fe4661dfa437c151da9ec617c8ff11 /test/Analysis | |
parent | 5cf6b6ca7c08d3bed3fd899e7a18fc5f58c736b5 (diff) |
[analyzer] Malloc: drop symbols captured by blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153232 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r-- | test/Analysis/malloc.mm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/Analysis/malloc.mm b/test/Analysis/malloc.mm index 31db5ced15..4cb2cfa328 100644 --- a/test/Analysis/malloc.mm +++ b/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); +} + |