Don't try to use ASan on Windows

Let ASan support depend on __has_feature(address_sanitizer) instead of defined(ADDRESS_SANITIZER)

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/213133002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20287 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d3ba6de7
......@@ -184,9 +184,6 @@
'ldflags': [
'-fsanitize=address',
],
'defines': [
'ADDRESS_SANITIZER',
],
},
}],
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
......
......@@ -30,7 +30,7 @@
#include "zone.h"
#ifdef ADDRESS_SANITIZER
#ifdef V8_USE_ADDRESS_SANITIZER
#include <sanitizer/asan_interface.h>
#else
#define ASAN_UNPOISON_MEMORY_REGION(start, size) ((void) 0)
......@@ -64,7 +64,7 @@ inline void* Zone::New(int size) {
Address result = position_;
int size_with_redzone =
#ifdef ADDRESS_SANITIZER
#ifdef V8_USE_ADDRESS_SANITIZER
size + kASanRedzoneBytes;
#else
size;
......@@ -76,7 +76,7 @@ inline void* Zone::New(int size) {
position_ += size_with_redzone;
}
#ifdef ADDRESS_SANITIZER
#ifdef V8_USE_ADDRESS_SANITIZER
Address redzone_position = result + size;
ASSERT(redzone_position + kASanRedzoneBytes == position_);
ASAN_POISON_MEMORY_REGION(redzone_position, kASanRedzoneBytes);
......
......@@ -38,6 +38,11 @@
namespace v8 {
namespace internal {
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
#define V8_USE_ADDRESS_SANITIZER
#endif
#endif
class Segment;
class Isolate;
......@@ -90,7 +95,7 @@ class Zone {
// All pointers returned from New() have this alignment. In addition, if the
// object being allocated has a size that is divisible by 8 then its alignment
// will be 8. ASan requires 8-byte alignment.
#ifdef ADDRESS_SANITIZER
#ifdef V8_USE_ADDRESS_SANITIZER
static const int kAlignment = 8;
STATIC_ASSERT(kPointerSize <= 8);
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment