summaryrefslogtreecommitdiffstats
path: root/test/Analysis
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-03-26 18:18:39 +0000
committerAnna Zaks <ganna@apple.com>2012-03-26 18:18:39 +0000
commit4cd7edfa851ff5d9b37d09539a77685a12e82994 (patch)
tree2f1670dbeb4b3116ad8b3a00b3421b1e5dff3819 /test/Analysis
parent54edd4764db4c266359f757daabdb0189199e4ed (diff)
[analyzer] Malloc: Allow a pointer to escape through OSAtomicEnqueue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153453 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/malloc.mm11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Analysis/malloc.mm b/test/Analysis/malloc.mm
index 4cb2cfa328..fe14edeedd 100644
--- a/test/Analysis/malloc.mm
+++ b/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);
+}
+