aboutsummaryrefslogtreecommitdiffstats
path: root/sys/targets
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-03-14 16:42:00 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-03-17 21:19:13 +0100
commit80d43738f1e4c648ccfc4599e17dc8ba455fe1ea (patch)
treea2adb84b67e9d760a35fee40ddf06d271f70bab1 /sys/targets
parenta2f9a446496d23c4bf6db95e0d4337583595c78c (diff)
prog: rename target.SanitizeCall to Neutralize
We will need a wrapper for target.SanitizeCall that will do more than just calling the target-provided function. To avoid confusion and potential mistakes, give the target function and prog function different names. Prog package will continue to call this "sanitize", which will include target's "neutralize" + more. Also refactor API a bit: we need a helper function that sanitizes the whole program because that's needed most of the time. Fixes #477 Fixes #502
Diffstat (limited to 'sys/targets')
-rw-r--r--sys/targets/common.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/targets/common.go b/sys/targets/common.go
index 0096bcf75..a5a4838c2 100644
--- a/sys/targets/common.go
+++ b/sys/targets/common.go
@@ -51,7 +51,7 @@ func MakeSyzMmap(target *prog.Target) func(addr, size uint64) *prog.Call {
}
}
-type UnixSanitizer struct {
+type UnixNeutralizer struct {
MAP_FIXED uint64
S_IFREG uint64
S_IFCHR uint64
@@ -60,8 +60,8 @@ type UnixSanitizer struct {
S_IFSOCK uint64
}
-func MakeUnixSanitizer(target *prog.Target) *UnixSanitizer {
- return &UnixSanitizer{
+func MakeUnixNeutralizer(target *prog.Target) *UnixNeutralizer {
+ return &UnixNeutralizer{
MAP_FIXED: target.GetConst("MAP_FIXED"),
S_IFREG: target.GetConst("S_IFREG"),
S_IFCHR: target.GetConst("S_IFCHR"),
@@ -71,7 +71,7 @@ func MakeUnixSanitizer(target *prog.Target) *UnixSanitizer {
}
}
-func (arch *UnixSanitizer) SanitizeCall(c *prog.Call) {
+func (arch *UnixNeutralizer) Neutralize(c *prog.Call) {
switch c.Meta.CallName {
case "mmap":
// Add MAP_FIXED flag, otherwise it produces non-deterministic results.