aboutsummaryrefslogtreecommitdiffstats
path: root/brillo/asan.h
blob: 9a73202d6e7b9708629a113ff9595883cc8e9eff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright 2018 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// This header provides Address Sanitizer specific macros.
//
#ifndef LIBBRILLO_BRILLO_ASAN_H_
#define LIBBRILLO_BRILLO_ASAN_H_

#if defined(__has_feature) && __has_feature(address_sanitizer)
// ASan is enabled.
#define BRILLO_ASAN_BUILD 1
// Provide BRILLO_DISABLE_ASAN hook to disable ASan.
// Put this in front on functions or global variables where required.
#define BRILLO_DISABLE_ASAN __attribute__((no_sanitize("address")))
#else
#define BRILLO_DISABLE_ASAN
#endif

#endif