From 76e7c3dfb40a870aae0c0750206dd24d26411b0c Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 25 Aug 2018 09:05:51 -0700 Subject: 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. --- sys/netbsd/init.go | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'sys') 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 } -- cgit mrf-deployment