Flutter Engine
The Flutter Engine
undefined_behavior_sanitizer.h
Go to the documentation of this file.
1// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_PLATFORM_UNDEFINED_BEHAVIOR_SANITIZER_H_
6#define RUNTIME_PLATFORM_UNDEFINED_BEHAVIOR_SANITIZER_H_
7
8#if __SANITIZE_UNDEFINED__
9#define USING_UNDEFINED_BEHAVIOR_SANITIZER
10#elif defined(__has_feature)
11#if __has_feature(undefined_behavior_sanitizer)
12#define USING_UNDEFINED_BEHAVIOR_SANITIZER
13#endif
14#endif
15
16#if defined(USING_UNDEFINED_BEHAVIOR_SANITIZER)
17#define NO_SANITIZE_UNDEFINED(check) __attribute__((no_sanitize(check)))
18#else
19#define NO_SANITIZE_UNDEFINED(check)
20#endif
21
22#endif // RUNTIME_PLATFORM_UNDEFINED_BEHAVIOR_SANITIZER_H_