aboutsummaryrefslogtreecommitdiffstats
path: root/prog/hints.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-09-05 13:31:14 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-09-05 15:52:42 +0200
commitffe7e17368d7ae6c2b40da2ce0703d8ad8a116ac (patch)
tree195b7c32977fdaab05acb1282a727fb480593431 /prog/hints.go
parent4fc47026945ebec3fc81d0c897547670034cfb58 (diff)
prog, sys: move types to prog
Large overhaul moves syscalls and arg types from sys to prog. Sys package now depends on prog and contains only generated descriptions of syscalls. Introduce prog.Target type that encapsulates all targer properties, like syscall list, ptr/page size, etc. Also moves OS-dependent pieces like mmap call generation from prog to sys. Update #191
Diffstat (limited to 'prog/hints.go')
-rw-r--r--prog/hints.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/prog/hints.go b/prog/hints.go
index ba8131081..e268d46a6 100644
--- a/prog/hints.go
+++ b/prog/hints.go
@@ -20,8 +20,6 @@ package prog
import (
"encoding/binary"
-
- . "github.com/google/syzkaller/sys"
)
type uint64Set map[uint64]bool
@@ -95,7 +93,7 @@ func generateHints(p *Prog, compMap CompMap, c *Call, arg Arg, exec func(p *Prog
switch a := arg.(type) {
case *ConstArg:
- originalArg = constArg(a.Type(), a.Val)
+ originalArg = MakeConstArg(a.Type(), a.Val)
checkConstArg(a, compMap, constArgCandidate)
case *DataArg:
originalArg = dataArg(a.Type(), a.Data)
@@ -105,7 +103,7 @@ func generateHints(p *Prog, compMap CompMap, c *Call, arg Arg, exec func(p *Prog
func checkConstArg(arg *ConstArg, compMap CompMap, cb func(newArg Arg)) {
for replacer := range shrinkExpand(arg.Val, compMap) {
- cb(constArg(arg.typ, replacer))
+ cb(MakeConstArg(arg.typ, replacer))
}
}