Merge "Fix evaluation order of (Cfi|Memtag) exclude paths." am: d820c37425

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1672705

Change-Id: Iaaf3bc97fb9d337eb0fc258b4278a3d120965512
This commit is contained in:
Treehugger Robot 2021-04-15 04:42:26 +00:00 committed by Automerger Merge Worker
commit 6ff0d4084e
2 changed files with 6 additions and 5 deletions

View File

@ -1259,7 +1259,7 @@ func (c *config) CFIEnabledForPath(path string) bool {
if len(c.productVariables.CFIIncludePaths) == 0 {
return false
}
return HasAnyPrefix(path, c.productVariables.CFIIncludePaths)
return HasAnyPrefix(path, c.productVariables.CFIIncludePaths) && !c.CFIDisabledForPath(path)
}
func (c *config) MemtagHeapDisabledForPath(path string) bool {
@ -1273,14 +1273,14 @@ func (c *config) MemtagHeapAsyncEnabledForPath(path string) bool {
if len(c.productVariables.MemtagHeapAsyncIncludePaths) == 0 {
return false
}
return HasAnyPrefix(path, c.productVariables.MemtagHeapAsyncIncludePaths)
return HasAnyPrefix(path, c.productVariables.MemtagHeapAsyncIncludePaths) && !c.MemtagHeapDisabledForPath(path)
}
func (c *config) MemtagHeapSyncEnabledForPath(path string) bool {
if len(c.productVariables.MemtagHeapSyncIncludePaths) == 0 {
return false
}
return HasAnyPrefix(path, c.productVariables.MemtagHeapSyncIncludePaths)
return HasAnyPrefix(path, c.productVariables.MemtagHeapSyncIncludePaths) && !c.MemtagHeapDisabledForPath(path)
}
func (c *config) VendorConfig(name string) VendorConfig {

View File

@ -3921,8 +3921,9 @@ var prepareForTestWithMemtagHeap = android.GroupFixturePreparers(
}),
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
variables.MemtagHeapExcludePaths = []string{"subdir_exclude"}
variables.MemtagHeapSyncIncludePaths = []string{"subdir_sync"}
variables.MemtagHeapAsyncIncludePaths = []string{"subdir_async"}
// "subdir_exclude" is covered by both include and exclude paths. Exclude wins.
variables.MemtagHeapSyncIncludePaths = []string{"subdir_sync", "subdir_exclude"}
variables.MemtagHeapAsyncIncludePaths = []string{"subdir_async", "subdir_exclude"}
}),
)