diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-08-25 09:05:51 -0700 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-08-25 09:05:51 -0700 |
| commit | 76e7c3dfb40a870aae0c0750206dd24d26411b0c (patch) | |
| tree | 1836c9c4762422a9a9fdff29bc16e573df950cff /sys/netbsd | |
| parent | bf3cf0c965acde4217280429327c9012b37aaf17 (diff) | |
sys/netbsd: use posix helper instead of copy-pasted code
We now have this common logic in sys/targets,
so use it instread of copy-pasted code.
I missed this file during the refactoring.
Diffstat (limited to 'sys/netbsd')
| -rw-r--r-- | sys/netbsd/init.go | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/sys/netbsd/init.go b/sys/netbsd/init.go index 7b6b1250e..c039f4d43 100644 --- a/sys/netbsd/init.go +++ b/sys/netbsd/init.go @@ -10,29 +10,13 @@ import ( func InitTarget(target *prog.Target) { arch := &arch{ - MAP_FIXED: target.ConstMap["MAP_FIXED"], + unix: targets.MakeUnixSanitizer(target), } target.MakeMmap = targets.MakePosixMmap(target) - target.SanitizeCall = arch.sanitizeCall + target.SanitizeCall = arch.unix.SanitizeCall } type arch struct { - MAP_FIXED uint64 -} - -func (arch *arch) sanitizeCall(c *prog.Call) { - switch c.Meta.CallName { - case "mmap": - // Add MAP_FIXED flag, otherwise it produces non-deterministic results. - c.Args[3].(*prog.ConstArg).Val |= arch.MAP_FIXED - case "mknod", "mknodat": - break - case "exit": - code := c.Args[0].(*prog.ConstArg) - // These codes are reserved by executor. - if code.Val%128 == 67 || code.Val%128 == 68 { - code.Val = 1 - } - } + unix *targets.UnixSanitizer } |
