diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-10-20 12:23:21 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-10-23 09:59:39 +0200 |
| commit | 8fa0c867d4e4bbd97321b19ac11115fa7020570a (patch) | |
| tree | 12d25a05dc84fa5ad849acecc78b8cf073ed3998 /prog/hints.go | |
| parent | 5044885ca2e3e8fd8a368cb497946d994d1bb1ad (diff) | |
syz-fuzzer: generates hints only for the call that gave new coverage
During smashing we know what call gave new coverage,
so we can concentrate just on it.
This helps to reduce amount of hints generated (we have too many of them).
Diffstat (limited to 'prog/hints.go')
| -rw-r--r-- | prog/hints.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/prog/hints.go b/prog/hints.go index 5a05d7f56..87b92229d 100644 --- a/prog/hints.go +++ b/prog/hints.go @@ -47,15 +47,14 @@ func (m CompMap) AddComp(arg1, arg2 uint64) { // Mutates the program using the comparison operands stored in compMaps. // For each of the mutants executes the exec callback. -func (p *Prog) MutateWithHints(compMaps []CompMap, exec func(newP *Prog)) { - for i, c := range p.Calls { - if c.Meta == p.Target.MmapSyscall { - continue - } - foreachArg(c, func(arg, _ Arg, _ *[]Arg) { - generateHints(p, compMaps[i], c, arg, exec) - }) +func (p *Prog) MutateWithHints(callIndex int, comps CompMap, exec func(newP *Prog)) { + c := p.Calls[callIndex] + if c.Meta == p.Target.MmapSyscall { + return } + foreachArg(c, func(arg, _ Arg, _ *[]Arg) { + generateHints(p, comps, c, arg, exec) + }) } func generateHints(p *Prog, compMap CompMap, c *Call, arg Arg, exec func(p *Prog)) { |
