From e6567fe56b4779408584360536a0cbe6eca50ace Mon Sep 17 00:00:00 2001 From: Muhammad Haseeb Ahmad Date: Tue, 24 May 2022 21:09:46 +0000 Subject: [PATCH] Make IsSanitizerEnabledForJni return false Change-Id: I5e1722bc32b63649fc9973d11e9fd5bdea72ddbe Test: m --- cc/sanitize.go | 5 ++++- java/fuzz.go | 11 ++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cc/sanitize.go b/cc/sanitize.go index 87cee9f02..42a112ed4 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -1428,9 +1428,12 @@ func sanitizerMutator(t SanitizerType) func(android.BottomUpMutatorContext) { } } } else if sanitizeable, ok := mctx.Module().(Sanitizeable); ok && sanitizeable.IsSanitizerEnabled(mctx, t.name()) { - // APEX and Java fuzz modules fall here + // APEX fuzz modules fall here sanitizeable.AddSanitizerDependencies(mctx, t.name()) mctx.CreateVariations(t.variationName()) + } else if _, ok := mctx.Module().(JniSanitizeable); ok { + // Java fuzz modules fall here + mctx.CreateVariations(t.variationName()) } else if c, ok := mctx.Module().(*Module); ok { //TODO: When Rust modules have vendor support, enable this path for PlatformSanitizeable diff --git a/java/fuzz.go b/java/fuzz.go index cf2c981d5..b306991da 100644 --- a/java/fuzz.go +++ b/java/fuzz.go @@ -54,11 +54,12 @@ type JavaFuzzLibrary struct { // cc.JniSanitizeable. It returns a bool for whether a cc dependency should be // sanitized for the given sanitizer or not. func (j *JavaFuzzLibrary) IsSanitizerEnabledForJni(ctx android.BaseModuleContext, sanitizerName string) bool { - for _, s := range j.jniProperties.Sanitizers { - if sanitizerName == s { - return true - } - } + // TODO: once b/231370928 is resolved, please uncomment the loop + // for _, s := range j.jniProperties.Sanitizers { + // if sanitizerName == s { + // return true + // } + // } return false }