ronnie
2022-10-23 68f5ca84d926736535296469a2d3fcbea06ca8a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// 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.
 
#ifndef V8_ASAN_H_
#define V8_ASAN_H_
 
#include "src/base/macros.h"
#include "src/globals.h"
 
#ifdef V8_USE_ADDRESS_SANITIZER
 
#include <sanitizer/asan_interface.h>
 
#else  // !V8_USE_ADDRESS_SANITIZER
 
#define ASAN_POISON_MEMORY_REGION(start, size)                         \
  static_assert(                                                       \
      (std::is_pointer<decltype(start)>::value ||                      \
       std::is_same<v8::internal::Address, decltype(start)>::value) && \
          std::is_convertible<decltype(size), size_t>::value,          \
      "static type violation")
#define ASAN_UNPOISON_MEMORY_REGION(start, size) \
  ASAN_POISON_MEMORY_REGION(start, size)
 
#endif  // V8_USE_ADDRESS_SANITIZER
 
#endif  // V8_ASAN_H_