Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d820c374 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

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

parents ccaf57c6 779b64ec
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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 {
+3 −2
Original line number Diff line number Diff line
@@ -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"}
	}),
)