diff options
author | Eugene Leviant <eleviant@accesssoftek.com> | 2019-07-28 08:58:44 +0000 |
---|---|---|
committer | Eugene Leviant <eleviant@accesssoftek.com> | 2019-07-28 08:58:44 +0000 |
commit | ae21b4c5a36ab2e2ccd92bf89d768b4c09e7b7e0 (patch) | |
tree | 7562ff2c0387ae245da22cd9465e874576f35f6d /lib/sanitizer_common | |
parent | 33ed658ca8e891f2b8f753429e7257630e09afb2 (diff) | |
download | compiler-rt-ae21b4c5a36ab2e2ccd92bf89d768b4c09e7b7e0.tar.gz |
Don't initialize interceptor_metadata_map unless SI_POSIX is set
Differential revision: https://reviews.llvm.org/D64794
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367188 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common')
-rw-r--r-- | lib/sanitizer_common/sanitizer_common_interceptors.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_common_interceptors.inc b/lib/sanitizer_common/sanitizer_common_interceptors.inc index e805c8649..16bdffe4c 100644 --- a/lib/sanitizer_common/sanitizer_common_interceptors.inc +++ b/lib/sanitizer_common/sanitizer_common_interceptors.inc @@ -317,11 +317,11 @@ struct CommonInterceptorMetadata { }; }; +#if SI_POSIX typedef AddrHashMap<CommonInterceptorMetadata, 31051> MetadataHashMap; static MetadataHashMap *interceptor_metadata_map; -#if SI_POSIX UNUSED static void SetInterceptorMetadata(__sanitizer_FILE *addr, const FileMetadata &file) { MetadataHashMap::Handle h(interceptor_metadata_map, (uptr)addr); @@ -9551,9 +9551,11 @@ INTERCEPTOR(void, sl_free, void *sl, int freeall) { #endif static void InitializeCommonInterceptors() { +#if SI_POSIX static u64 metadata_mem[sizeof(MetadataHashMap) / sizeof(u64) + 1]; interceptor_metadata_map = new ((void *)&metadata_mem) MetadataHashMap(); // NOLINT +#endif INIT_MMAP; INIT_MMAP64; |