summaryrefslogtreecommitdiff
path: root/include/__config
diff options
context:
space:
mode:
Diffstat (limited to 'include/__config')
-rw-r--r--include/__config9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/__config b/include/__config
index c0b1ef201c055..db5a832b6cd14 100644
--- a/include/__config
+++ b/include/__config
@@ -433,6 +433,11 @@ namespace std {
#define _LIBCPP_HAS_NO_ASAN
#endif
+// Allow for build-time disabling of unsigned integer sanitization
+#ifndef _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+#define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute((no_sanitize("unsigned-integer-overflow")))
+#endif
+
#elif defined(__GNUC__)
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
@@ -826,6 +831,10 @@ extern "C" void __sanitizer_annotate_contiguous_container(
#define _LIBCPP_HAS_NO_ATOMIC_HEADER
#endif
+#ifndef _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+#define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+#endif
+
#endif // __cplusplus
#endif // _LIBCPP_CONFIG