diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-03-14 16:42:00 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-03-17 21:19:13 +0100 |
| commit | 80d43738f1e4c648ccfc4599e17dc8ba455fe1ea (patch) | |
| tree | a2adb84b67e9d760a35fee40ddf06d271f70bab1 /sys/openbsd/init.go | |
| parent | a2f9a446496d23c4bf6db95e0d4337583595c78c (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/openbsd/init.go')
| -rw-r--r-- | sys/openbsd/init.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/openbsd/init.go b/sys/openbsd/init.go index e7c5d08f6..e27ba8d60 100644 --- a/sys/openbsd/init.go +++ b/sys/openbsd/init.go @@ -13,19 +13,19 @@ import ( func InitTarget(target *prog.Target) { arch := &arch{ - unix: targets.MakeUnixSanitizer(target), + unix: targets.MakeUnixNeutralizer(target), DIOCKILLSTATES: target.GetConst("DIOCKILLSTATES"), S_IFMT: target.GetConst("S_IFMT"), S_IFCHR: target.GetConst("S_IFCHR"), } target.MakeMmap = targets.MakePosixMmap(target) - target.SanitizeCall = arch.SanitizeCall + target.Neutralize = arch.neutralize target.AnnotateCall = arch.annotateCall } type arch struct { - unix *targets.UnixSanitizer + unix *targets.UnixNeutralizer DIOCKILLSTATES uint64 S_IFMT uint64 S_IFCHR uint64 @@ -72,7 +72,7 @@ func isKcovFd(dev uint64) bool { return major == devFdMajor && minor >= kcovFdMinorMin && minor < kcovFdMinorMax } -func (arch *arch) SanitizeCall(c *prog.Call) { +func (arch *arch) neutralize(c *prog.Call) { argStart := 1 switch c.Meta.CallName { case "chflagsat": @@ -169,7 +169,7 @@ func (arch *arch) SanitizeCall(c *prog.Call) { } } default: - arch.unix.SanitizeCall(c) + arch.unix.Neutralize(c) } } |
