Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: Source/platform/heap/AddressSanitizer.h

Issue 294653002: Define the NO_SANITIZE_ADDRESS macro in a 'clang-cl /fallback' friendly way (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address the comment Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/AddressSanitizer.h
diff --git a/Source/platform/heap/AddressSanitizer.h b/Source/platform/heap/AddressSanitizer.h
index 6f63ec7c2b416b553f38fedcba9b115cdb4a71b4..0ec6a35dba0d3da1d6beda586d7ba279f22fc54e 100644
--- a/Source/platform/heap/AddressSanitizer.h
+++ b/Source/platform/heap/AddressSanitizer.h
@@ -34,12 +34,20 @@
// FIXME: Add SyZyASan support?
#if defined(ADDRESS_SANITIZER)
#include <sanitizer/asan_interface.h>
-#define NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
#else
#define ASAN_POISON_MEMORY_REGION(addr, size) \
((void)(addr), (void)(size))
#define ASAN_UNPOISON_MEMORY_REGION(addr, size) \
((void)(addr), (void)(size))
+#endif
+
+// FIXME: Have to handle (ADDRESS_SANITIZER && _WIN32) differently as it uses
+// both Clang (which supports the __attribute__ syntax) and CL (which doesn't)
+// as long as we use "clang-cl /fallback". This shouldn't be needed when Clang
+// handles all the code without falling back to CL.
+#if defined(ADDRESS_SANITIZER) && (!OS(WIN) || COMPILER(CLANG))
+#define NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
+#else
#define NO_SANITIZE_ADDRESS
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698