diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-04-26 04:32:23 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-04-26 04:32:23 +0000 |
commit | 01d152f43fc919ff648c70b24a3883d178c707c7 (patch) | |
tree | 98d4272f36fa552cbb28807731b1424baa6760c8 /clang/test | |
parent | 359087cadeea9d4637622b977f79dd2c57620316 (diff) | |
download | bcm5719-llvm-01d152f43fc919ff648c70b24a3883d178c707c7.tar.gz bcm5719-llvm-01d152f43fc919ff648c70b24a3883d178c707c7.zip |
Teach RetainCountChecker that it doesn't quite understand pthread_setspecific and it should just give up when it sees it. Fixes <rdar://problem/11282706>.
llvm-svn: 155613
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Analysis/retain-release.m | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/Analysis/retain-release.m b/clang/test/Analysis/retain-release.m index 06c510e5dd3..3aa2656c62f 100644 --- a/clang/test/Analysis/retain-release.m +++ b/clang/test/Analysis/retain-release.m @@ -1055,10 +1055,14 @@ typedef struct _opaque_pthread_t *__darwin_pthread_t; typedef struct _opaque_pthread_attr_t __darwin_pthread_attr_t; typedef __darwin_pthread_t pthread_t; typedef __darwin_pthread_attr_t pthread_attr_t; +typedef unsigned long __darwin_pthread_key_t; +typedef __darwin_pthread_key_t pthread_key_t; int pthread_create(pthread_t *, const pthread_attr_t *, void *(*)(void *), void *); +int pthread_setspecific(pthread_key_t key, const void *value); + void *rdar_7299394_start_routine(void *p) { [((id) p) release]; return 0; @@ -1072,6 +1076,16 @@ void rdar_7299394_positive(pthread_attr_t *attr, pthread_t *thread) { } //===----------------------------------------------------------------------===// +// <rdar://problem/11282706> false positive with not understanding thread +// local storage +//===----------------------------------------------------------------------===// + +void rdar11282706(pthread_key_t key) { + NSNumber *number = [[NSNumber alloc] initWithInt:5]; // no-warning + pthread_setspecific(key, (void*) number); +} + +//===----------------------------------------------------------------------===// // <rdar://problem/7283567> False leak associated with call to // CVPixelBufferCreateWithBytes () // |