From c9b915608d0ae354e5666093c6e6bb7b11d5ce77 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 14 Oct 2015 16:55:09 +0200 Subject: initial support for call priorities --- prog/generation.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'prog/generation.go') diff --git a/prog/generation.go b/prog/generation.go index 43e527aa0..b08e98d31 100644 --- a/prog/generation.go +++ b/prog/generation.go @@ -5,18 +5,16 @@ package prog import ( "math/rand" - - "github.com/google/syzkaller/sys" ) // Generate generates a random program of length ~ncalls. // calls is a set of allowed syscalls, if nil all syscalls are used. -func Generate(rs rand.Source, ncalls int, enabledCalls []*sys.Call) *Prog { +func Generate(rs rand.Source, ncalls int, ct *ChoiceTable) *Prog { p := new(Prog) r := newRand(rs) - s := newState(enabledCalls) + s := newState(ct) for len(p.Calls) < ncalls { - calls := r.generateCall(s) + calls := r.generateCall(s, p) for _, c := range calls { s.analyze(c) p.Calls = append(p.Calls, c) -- cgit mrf-deployment