diff options
author | Ivan Lozano <ivanlozano@google.com> | 2017-07-13 14:46:05 -0700 |
---|---|---|
committer | Ivan Lozano <ivanlozano@google.com> | 2017-07-18 13:38:20 -0700 |
commit | 5f59553bca49ad4acd00625633c2a6fd5c4eb2c5 (patch) | |
tree | 5e787265050752194514347fb39151ce9219dfca /android/config.go | |
parent | da4a7257b5b4c4fd41b8e8e084713e3e4f20187b (diff) | |
download | build_soong-5f59553bca49ad4acd00625633c2a6fd5c4eb2c5.tar.gz build_soong-5f59553bca49ad4acd00625633c2a6fd5c4eb2c5.tar.bz2 build_soong-5f59553bca49ad4acd00625633c2a6fd5c4eb2c5.zip |
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=<path> and confirmed this was no
longer being applied to binaries in that path.
Change-Id: I298b772f5425da28dff1cf007825be19558db3a8
Diffstat (limited to 'android/config.go')
-rw-r--r-- | android/config.go | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/android/config.go b/android/config.go index 661e333d..5dcc59be 100644 --- a/android/config.go +++ b/android/config.go @@ -530,20 +530,21 @@ func (c *deviceConfig) NativeCoverageEnabled() bool { func (c *deviceConfig) CoverageEnabledForPath(path string) bool { coverage := false if c.config.ProductVariables.CoveragePaths != nil { - for _, prefix := range *c.config.ProductVariables.CoveragePaths { - if strings.HasPrefix(path, prefix) { - coverage = true - break - } + if prefixInList(path, *c.config.ProductVariables.CoveragePaths) { + coverage = true } } if coverage && c.config.ProductVariables.CoverageExcludePaths != nil { - for _, prefix := range *c.config.ProductVariables.CoverageExcludePaths { - if strings.HasPrefix(path, prefix) { - coverage = false - break - } + if prefixInList(path, *c.config.ProductVariables.CoverageExcludePaths) { + coverage = false } } return coverage } + +func (c *config) IntegerOverflowDisabledForPath(path string) bool { + if c.ProductVariables.IntegerOverflowExcludePaths == nil { + return false + } + return prefixInList(path, *c.ProductVariables.IntegerOverflowExcludePaths) +} |