Disable global coverage when a module disables asan.

With SANITIZE_TARGET="address coverage", if a module disables ASan
(address: false), it is left with just coverage, which is not
supported. In that case, disable coverage as well.

Bug: 33091541
Test: see above
Change-Id: Idcd04dad8cab7c7e2644d2408b1b8a381490e5af
This commit is contained in:
Evgenii Stepanov 2016-12-28 15:52:54 -08:00
parent 7ebf9fa3c9
commit 774cb81796

View file

@ -136,8 +136,14 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
s.Undefined = boolPtr(true)
}
if found, globalSanitizers = removeFromList("address", globalSanitizers); found && s.Address == nil {
s.Address = boolPtr(true)
if found, globalSanitizers = removeFromList("address", globalSanitizers); found {
if s.Address == nil {
s.Address = boolPtr(true)
} else if *s.Address == false {
// Coverage w/o address is an error. If globalSanitizers includes both, and the module
// disables address, then disable coverage as well.
_, globalSanitizers = removeFromList("coverage", globalSanitizers)
}
}
if found, globalSanitizers = removeFromList("thread", globalSanitizers); found && s.Thread == nil {