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

Commit f3e8fc3f authored by Ivan Lozano's avatar Ivan Lozano
Browse files

rust: Only apply hwasan flags once to fuzz targets

On HWASAN global sanitized builds, fuzz targets had hwasanFlags applied
twice. Rust only allows llvm-args flags to be passed in once however, so
this broke compilation.

Bug: 204915322
Test: SANITIZE_TARGET='hwaddress fuzzer' m <fuzzer>
Change-Id: I4f6c35e04bc4c891d9c66e8a53c3dcb88e8670cf
parent 52a3e36c
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -237,12 +237,10 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags, deps PathDeps) (
		} else {
			flags.RustFlags = append(flags.RustFlags, asanFlags...)
		}
	}
	if Bool(sanitize.Properties.Sanitize.Address) {
		flags.RustFlags = append(flags.RustFlags, asanFlags...)
	}
	if Bool(sanitize.Properties.Sanitize.Hwaddress) {
	} else if Bool(sanitize.Properties.Sanitize.Hwaddress) {
		flags.RustFlags = append(flags.RustFlags, hwasanFlags...)
	} else if Bool(sanitize.Properties.Sanitize.Address) {
		flags.RustFlags = append(flags.RustFlags, asanFlags...)
	}
	return flags, deps
}