OSDN Git Service

Fixup for r301054: Only use __attribute__((no_sanitize("memory"))) when it's available.
authorKuba Mracek <mracek@apple.com>
Fri, 21 Apr 2017 22:58:55 +0000 (22:58 +0000)
committerKuba Mracek <mracek@apple.com>
Fri, 21 Apr 2017 22:58:55 +0000 (22:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301058 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Fuzzer/FuzzerDefs.h

index 939b92f..27f5719 100644 (file)
 
 
 #ifdef __clang__  // avoid gcc warning.
-#  define ATTRIBUTE_NO_SANITIZE_MEMORY __attribute__((no_sanitize("memory")))
+#  if __has_attribute(no_sanitize)
+#    define ATTRIBUTE_NO_SANITIZE_MEMORY __attribute__((no_sanitize("memory")))
+#  else
+#    define ATTRIBUTE_NO_SANITIZE_MEMORY
+#  endif
 #  define ALWAYS_INLINE __attribute__((always_inline))
 #else
 #  define ATTRIBUTE_NO_SANITIZE_MEMORY