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

Commit f8434364 authored by Liz Kammer's avatar Liz Kammer Committed by Gerrit Code Review
Browse files

Merge changes Ia165e4be,I63fe74fb

* changes:
  Update sanitize to not modify user properties
  Extend sanitize_test.go
parents b8ae9cd9 2c1d6aae
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -203,6 +203,10 @@ func (ctx *TestContext) HardCodedPreArchMutators(f RegisterMutatorFunc) {
	ctx.PreArchMutators(f)
}

func (ctx *TestContext) ModuleProvider(m blueprint.Module, p blueprint.ProviderKey) interface{} {
	return ctx.Context.ModuleProvider(m, p)
}

func (ctx *TestContext) PreDepsMutators(f RegisterMutatorFunc) {
	ctx.preDeps = append(ctx.preDeps, f)
}
+9 −5
Original line number Diff line number Diff line
@@ -301,7 +301,6 @@ func NewFuzzer(hod android.HostOrDeviceSupported) *Module {
	baseInstallerPath := "fuzz"

	binary.baseInstaller = NewBaseInstaller(baseInstallerPath, baseInstallerPath, InstallInData)
	module.sanitize.SetSanitizer(Fuzzer, true)

	fuzzBin := &fuzzBinary{
		binaryDecorator: binary,
@@ -315,7 +314,11 @@ func NewFuzzer(hod android.HostOrDeviceSupported) *Module {

	// The fuzzer runtime is not present for darwin host modules, disable cc_fuzz modules when targeting darwin.
	android.AddLoadHook(module, func(ctx android.LoadHookContext) {
		disableDarwinAndLinuxBionic := struct {

		extraProps := struct {
			Sanitize struct {
				Fuzzer *bool
			}
			Target struct {
				Darwin struct {
					Enabled *bool
@@ -325,9 +328,10 @@ func NewFuzzer(hod android.HostOrDeviceSupported) *Module {
				}
			}
		}{}
		disableDarwinAndLinuxBionic.Target.Darwin.Enabled = BoolPtr(false)
		disableDarwinAndLinuxBionic.Target.Linux_bionic.Enabled = BoolPtr(false)
		ctx.AppendProperties(&disableDarwinAndLinuxBionic)
		extraProps.Sanitize.Fuzzer = BoolPtr(true)
		extraProps.Target.Darwin.Enabled = BoolPtr(false)
		extraProps.Target.Linux_bionic.Enabled = BoolPtr(false)
		ctx.AppendProperties(&extraProps)

		targetFramework := fuzz.GetFramework(ctx, fuzz.Cc)
		if !fuzz.IsValidFrameworkForModule(targetFramework, fuzz.Cc, fuzzBin.fuzzPackagedModule.FuzzProperties.Fuzzing_frameworks) {
+2 −2
Original line number Diff line number Diff line
@@ -759,10 +759,10 @@ func srcsForSanitizer(sanitize *sanitize, sanitized Sanitized) []string {
	if sanitize == nil {
		return nil
	}
	if Bool(sanitize.Properties.Sanitize.Address) && sanitized.Address.Srcs != nil {
	if sanitize.isSanitizerEnabled(Asan) && sanitized.Address.Srcs != nil {
		return sanitized.Address.Srcs
	}
	if Bool(sanitize.Properties.Sanitize.Hwaddress) && sanitized.Hwaddress.Srcs != nil {
	if sanitize.isSanitizerEnabled(Hwasan) && sanitized.Hwaddress.Srcs != nil {
		return sanitized.Hwaddress.Srcs
	}
	return sanitized.None.Srcs
+205 −104

File changed.

Preview size limit exceeded, changes collapsed.

+150 −42

File changed.

Preview size limit exceeded, changes collapsed.