aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-execprog
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-09-14 19:25:01 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-09-15 16:02:37 +0200
commit52a33fd516102a98d3753bf69417235b655a68dc (patch)
tree351ab73db934d3b4e4babbe27e8801c659f2631b /tools/syz-execprog
parent25f4fe0662f7f3b390d16b2e786f2ba0aa0293f1 (diff)
prog: remove default target and all global state
Now each prog function accepts the desired target explicitly. No global, implicit state involved. This is much cleaner and allows cross-OS/arch testing, etc.
Diffstat (limited to 'tools/syz-execprog')
-rw-r--r--tools/syz-execprog/execprog.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/syz-execprog/execprog.go b/tools/syz-execprog/execprog.go
index 53fcbb8ca..282e416e3 100644
--- a/tools/syz-execprog/execprog.go
+++ b/tools/syz-execprog/execprog.go
@@ -47,7 +47,8 @@ func main() {
os.Exit(1)
}
- if err := prog.SetDefaultTarget(runtime.GOOS, *flagArch); err != nil {
+ target, err := prog.GetTarget(runtime.GOOS, *flagArch)
+ if err != nil {
Fatalf("%v", err)
}
@@ -57,7 +58,7 @@ func main() {
if err != nil {
Fatalf("failed to read log file: %v", err)
}
- entries := prog.ParseLog(data)
+ entries := target.ParseLog(data)
for _, ent := range entries {
progs = append(progs, ent.P)
}