diff options
author | Alexander Potapenko <glider@google.com> | 2012-07-06 13:04:12 +0000 |
---|---|---|
committer | Alexander Potapenko <glider@google.com> | 2012-07-06 13:04:12 +0000 |
commit | bf9f6fbf015f687784e26f26570924be4ca3924f (patch) | |
tree | 4a61b997d3b4cd023bf96428db5a4555a1e99f20 /lib/asan/asan_mac.cc | |
parent | d079db6dfbf3b0ec5fa1cc8d093e0dae6f970bf8 (diff) | |
download | compiler-rt-bf9f6fbf015f687784e26f26570924be4ca3924f.tar.gz |
A portable way to check whether __CFInitialize has been called: compare kCFAllocatorSystemDefault._base._cfisa to 0.
This should fix http://code.google.com/p/address-sanitizer/issues/detail?id=87 on both Lion and Snow Leopard.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159821 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_mac.cc')
-rw-r--r-- | lib/asan/asan_mac.cc | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/lib/asan/asan_mac.cc b/lib/asan/asan_mac.cc index 740c011eb..b219e0ad4 100644 --- a/lib/asan/asan_mac.cc +++ b/lib/asan/asan_mac.cc @@ -379,28 +379,6 @@ INTERCEPTOR(int, pthread_workqueue_additem_np, pthread_workqueue_t workq, gencountp); } -// CF_RC_BITS, the layout of CFRuntimeBase and __CFStrIsConstant are internal -// and subject to change in further CoreFoundation versions. Apple does not -// guarantee any binary compatibility from release to release. - -// See http://opensource.apple.com/source/CF/CF-635.15/CFInternal.h -#if defined(__BIG_ENDIAN__) -#define CF_RC_BITS 0 -#endif - -#if defined(__LITTLE_ENDIAN__) -#define CF_RC_BITS 3 -#endif - -// See http://opensource.apple.com/source/CF/CF-635.15/CFRuntime.h -typedef struct __CFRuntimeBase { - uptr _cfisa; - u8 _cfinfo[4]; -#if __LP64__ - u32 _rc; -#endif -} CFRuntimeBase; - // See http://opensource.apple.com/source/CF/CF-635.15/CFString.c int __CFStrIsConstant(CFStringRef str) { CFRuntimeBase *base = (CFRuntimeBase*)str; |