diff options
author | Anna Zaks <ganna@apple.com> | 2012-03-26 18:18:39 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-03-26 18:18:39 +0000 |
commit | a651c4099d3875dd1a1ef6556ee71c915ae72b29 (patch) | |
tree | fc8b6866864176e42d1e95f2a6419163fb426b2a /clang/test/Analysis/malloc.mm | |
parent | 08e57e5ccf69de817434b6205dc6a65defe0f3e7 (diff) | |
download | bcm5719-llvm-a651c4099d3875dd1a1ef6556ee71c915ae72b29.tar.gz bcm5719-llvm-a651c4099d3875dd1a1ef6556ee71c915ae72b29.zip |
[analyzer] Malloc: Allow a pointer to escape through OSAtomicEnqueue.
llvm-svn: 153453
Diffstat (limited to 'clang/test/Analysis/malloc.mm')
-rw-r--r-- | clang/test/Analysis/malloc.mm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Analysis/malloc.mm b/clang/test/Analysis/malloc.mm index 4cb2cfa328a..fe14edeedd1 100644 --- a/clang/test/Analysis/malloc.mm +++ b/clang/test/Analysis/malloc.mm @@ -106,3 +106,14 @@ void testBlocks() { myBlock(3); } +// Test that we handle pointer escaping through OSAtomicEnqueue. +typedef volatile struct { + void *opaque1; + long opaque2; +} OSQueueHead; +void OSAtomicEnqueue( OSQueueHead *__list, void *__new, size_t __offset) __attribute__((weak_import)); +static inline void radar11111210(OSQueueHead *pool) { + void *newItem = malloc(4); + OSAtomicEnqueue(pool, newItem, 4); +} + |