From 5f59553bca49ad4acd00625633c2a6fd5c4eb2c5 Mon Sep 17 00:00:00 2001 From: Ivan Lozano Date: Thu, 13 Jul 2017 14:46:05 -0700 Subject: Allow integer_overflow sanitizer path exclusion. Add support for excluding paths from having integer_overflow applied to them when using SANITIZE_TARGET=integer_overflow via an INTEGER_OVERFLOW_EXCLUDE_PATHS make variable. This covers the soong side of the change. Bug: 30969751 Test: Build with SANITIZE_TARGET=integer_overflow SANITIZE_TARGET_DIAG=integer_overflow INTEGER_OVERFLOW_EXCLUDE_PATHS= and confirmed this was no longer being applied to binaries in that path. Change-Id: I298b772f5425da28dff1cf007825be19558db3a8 --- cc/sanitize.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cc') diff --git a/cc/sanitize.go b/cc/sanitize.go index 49bd0f31..eccd2558 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -188,7 +188,9 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) { } if found, globalSanitizers = removeFromList("integer_overflow", globalSanitizers); found && s.Integer_overflow == nil { - s.Integer_overflow = boolPtr(true) + if !ctx.AConfig().IntegerOverflowDisabledForPath(ctx.ModuleDir()) { + s.Integer_overflow = boolPtr(true) + } } if len(globalSanitizers) > 0 { -- cgit v1.2.3