From: Eugene Leviant Date: Sun, 28 Jul 2019 08:58:44 +0000 (+0000) Subject: Don't initialize interceptor_metadata_map unless SI_POSIX is set X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=45d910de994098142d6e8ffae94963df0f649dc2;p=platform%2Fupstream%2Fllvm.git Don't initialize interceptor_metadata_map unless SI_POSIX is set Differential revision: https://reviews.llvm.org/D64794 llvm-svn: 367188 --- diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc index e805c86..16bdffe 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc @@ -317,11 +317,11 @@ struct CommonInterceptorMetadata { }; }; +#if SI_POSIX typedef AddrHashMap 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;