Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Unified Diff: build/config/sanitizers/sanitizers.gni

Issue 2028383006: Add GN configs for -fsanitizer=null. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/config/sanitizers/sanitizers.gni
diff --git a/build/config/sanitizers/sanitizers.gni b/build/config/sanitizers/sanitizers.gni
index da79bd79e2a7e1d96397e51693f0a1d11287b5dd..810c5051a874d4508257b4d52b94df7539fdabda 100644
--- a/build/config/sanitizers/sanitizers.gni
+++ b/build/config/sanitizers/sanitizers.gni
@@ -22,6 +22,9 @@ declare_args() {
# Halt the program if a problem is detected.
is_ubsan_no_recover = false
+ # Compile for Undefined Behaviour Sanitizer's null pointer checks.
+ is_ubsan_null = false
+
# Compile for Undefined Behaviour Sanitizer's vptr checks.
is_ubsan_vptr = false
@@ -92,7 +95,7 @@ if (use_sanitizer_coverage && sanitizer_coverage_flags == "") {
}
using_sanitizer = is_asan || is_lsan || is_tsan || is_msan || is_ubsan ||
- is_ubsan_vptr || is_ubsan_security
+ is_ubsan_null || is_ubsan_vptr || is_ubsan_security
assert(!using_sanitizer || is_clang,
"Sanitizers (is_*san) require setting is_clang = true in 'gn args'")
@@ -110,6 +113,6 @@ assert(!using_sanitizer || is_clang,
# unsupported or unadvisable configurations.
#
# For one-off testing, just comment this assertion out.
-assert(
- !is_debug || !(is_msan || is_lsan || is_tsan || is_ubsan || is_ubsan_vptr),
- "Sanitizers should generally be used in release (set is_debug=false).")
+assert(!is_debug || !(is_msan || is_lsan || is_tsan || is_ubsan ||
+ is_ubsan_null || is_ubsan_vptr),
+ "Sanitizers should generally be used in release (set is_debug=false).")

Powered by Google App Engine
This is Rietveld 408576698