From 91169fe8ea400d266e10af2c387d0d562a4d45a9 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 11 Aug 2016 15:54:20 -0700 Subject: [PATCH] Fix coverage sanitizer builds Disable coverage for static binaries where address sanitizer is disabled, and disable coverage in the mutator when disabling address sanitizer. Bug: 29188876 Change-Id: Ia1a21878c3f34cd295a6dec49608c412eb09e7b1 --- cc/sanitize.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cc/sanitize.go b/cc/sanitize.go index fb7cb3716..b79e0c742 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -140,6 +140,7 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) { if ctx.staticBinary() { s.Address = nil + s.Coverage = nil s.Thread = nil } @@ -317,6 +318,9 @@ func (sanitize *sanitize) SetSanitizer(t sanitizerType, b bool) { switch t { case asan: sanitize.Properties.Sanitize.Address = boolPtr(b) + if !b { + sanitize.Properties.Sanitize.Coverage = nil + } case tsan: sanitize.Properties.Sanitize.Thread = boolPtr(b) default: