Changeset 200654 in webkit
- Timestamp:
- May 10, 2016, 4:47:10 PM (9 years ago)
- Location:
- trunk/Source/bmalloc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/bmalloc/ChangeLog
r200386 r200654 1 2016-05-10 David Kilzer <ddkilzer@apple.com> 2 3 bmalloc should automatically disable itself when ThreadSanitizer is used 4 <https://webkit.org/b/157527> 5 6 Reviewed by Michael Catanzaro. 7 8 * bmalloc/Environment.cpp: 9 (bmalloc::isASanEnabled): Rename to isSanitizerEnabled. 10 (bmalloc::isSanitizerEnabled): Rename from isASanEnabled. Add 11 support for detecting ThreadSanitizer. 12 (bmalloc::Environment::computeIsBmallocEnabled): Switch from 13 isASanEnabled to isSanitizerEnabled. 14 1 15 2016-05-03 Geoffrey Garen <ggaren@apple.com> 2 16 -
trunk/Source/bmalloc/bmalloc/Environment.cpp
r189181 r200654 76 76 } 77 77 78 static bool is ASanEnabled()78 static bool isSanitizerEnabled() 79 79 { 80 80 #if BOS(DARWIN) 81 static const char sanitizerPrefix[] = "/libclang_rt."; 82 static const char asanName[] = "asan_"; 83 static const char tsanName[] = "tsan_"; 81 84 uint32_t imageCount = _dyld_image_count(); 82 85 for (uint32_t i = 0; i < imageCount; ++i) { … … 84 87 if (!imageName) 85 88 continue; 86 if (strstr(imageName, "/libclang_rt.asan_")) 87 return true; 89 if (const char* s = strstr(imageName, sanitizerPrefix)) { 90 const char* sanitizerName = s + sizeof(sanitizerPrefix) - 1; 91 if (!strncmp(sanitizerName, asanName, sizeof(asanName) - 1)) 92 return true; 93 if (!strncmp(sanitizerName, tsanName, sizeof(tsanName) - 1)) 94 return true; 95 } 88 96 } 89 97 return false; … … 92 100 if (!handle) 93 101 return false; 94 bool result = !!dlsym(handle, "__asan_ poison_memory_region");102 bool result = !!dlsym(handle, "__asan_init") || !!dlsym(handle, "__tsan_init"); 95 103 dlclose(handle); 96 104 return result; … … 111 119 if (isLibgmallocEnabled()) 112 120 return false; 113 if (is ASanEnabled())121 if (isSanitizerEnabled()) 114 122 return false; 115 123 return true;
Note:
See TracChangeset
for help on using the changeset viewer.