Fix for ndk having sanitizers

Test: go test soong tests
Test: verify no NeuralNetworksTest_random_graph sdk variants in
    build.ninja when aosp_x86 is lunched
Bug: 302093869
Change-Id: I6429aa75518cca6974abcf7330236a6a07135ea1
This commit is contained in:
Liz Kammer
2023-09-26 16:48:04 -04:00
parent 2863e4535e
commit ba23cb6436
2 changed files with 126 additions and 3 deletions

View File

@@ -1113,12 +1113,15 @@ func (sanitize *sanitize) isSanitizerExplicitlyDisabled(t SanitizerType) bool {
// indirectly (via a mutator) sets the bool ptr to true, and you can't
// distinguish between the cases. It isn't needed though - both cases can be
// treated identically.
func (sanitize *sanitize) isSanitizerEnabled(t SanitizerType) bool {
if sanitize == nil {
func (s *sanitize) isSanitizerEnabled(t SanitizerType) bool {
if s == nil {
return false
}
if proptools.Bool(s.Properties.SanitizeMutated.Never) {
return false
}
sanitizerVal := sanitize.getSanitizerBoolPtr(t)
sanitizerVal := s.getSanitizerBoolPtr(t)
return sanitizerVal != nil && *sanitizerVal == true
}