• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // This header provides Address Sanitizer specific macros.
6 //
7 #ifndef LIBBRILLO_BRILLO_ASAN_H_
8 #define LIBBRILLO_BRILLO_ASAN_H_
9 
10 #if defined(__has_feature) && __has_feature(address_sanitizer)
11 // ASan is enabled.
12 #define BRILLO_ASAN_BUILD 1
13 // Provide BRILLO_DISABLE_ASAN hook to disable ASan.
14 // Put this in front on functions or global variables where required.
15 #define BRILLO_DISABLE_ASAN __attribute__((no_sanitize("address")))
16 #else
17 #define BRILLO_DISABLE_ASAN
18 #endif
19 
20 #endif  // LIBBRILLO_BRILLO_ASAN_H_
21