asan.h 853 Bytes
Newer Older
1 2 3 4 5 6
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// AddressSanitizer support.

7 8
#ifndef V8_SANITIZER_ASAN_H_
#define V8_SANITIZER_ASAN_H_
9 10

#include "src/base/macros.h"
11
#include "src/common/globals.h"
12 13 14 15 16 17 18

#ifdef V8_USE_ADDRESS_SANITIZER

#include <sanitizer/asan_interface.h>

#else  // !V8_USE_ADDRESS_SANITIZER

19 20 21 22
#define ASAN_POISON_MEMORY_REGION(start, size)                          \
  static_assert(std::is_pointer<decltype(start)>::value &&              \
                    std::is_convertible<decltype(size), size_t>::value, \
                "static type violation")
23 24 25 26 27
#define ASAN_UNPOISON_MEMORY_REGION(start, size) \
  ASAN_POISON_MEMORY_REGION(start, size)

#endif  // V8_USE_ADDRESS_SANITIZER

28
#endif  // V8_SANITIZER_ASAN_H_