Update memtag code behavior to match comment.
Test: go test soong tests
Change-Id: I630c06f01c90256b1990c37b9236e8967a5fa316
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 0199897..0ed0d47 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -293,9 +293,13 @@
}
// cc_test targets default to SYNC MemTag unless explicitly set to ASYNC (via diag: {memtag_heap}).
- if ctx.testBinary() && s.Memtag_heap == nil {
- s.Memtag_heap = proptools.BoolPtr(true)
- s.Diag.Memtag_heap = proptools.BoolPtr(true)
+ if ctx.testBinary() {
+ if s.Memtag_heap == nil {
+ s.Memtag_heap = proptools.BoolPtr(true)
+ }
+ if s.Diag.Memtag_heap == nil {
+ s.Diag.Memtag_heap = proptools.BoolPtr(true)
+ }
}
var globalSanitizers []string