diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-03-13 19:06:12 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-03-14 09:58:39 +0000 |
| commit | afb4ef03152e930503768785ac23933a8a35e52c (patch) | |
| tree | 5a58b4a3254a1d100ac21b628bbdeb4def2ed26f /tools | |
| parent | 8d8ee1167660b892b706638362d61fd150a905af (diff) | |
prog: enable MutateWithHints() abortion
The call may potentially generate a very large number of possible
mutations. Add a way to abort the process.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/syz-execprog/execprog.go | 3 | ||||
| -rw-r--r-- | tools/syz-mutate/mutate.go | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/tools/syz-execprog/execprog.go b/tools/syz-execprog/execprog.go index f7952b675..b1c355a1b 100644 --- a/tools/syz-execprog/execprog.go +++ b/tools/syz-execprog/execprog.go @@ -251,11 +251,12 @@ func (ctx *Context) printHints(p *prog.Prog, info *ipc.ProgInfo) { fmt.Printf("\n") } } - p.MutateWithHints(i, comps, func(p *prog.Prog) { + p.MutateWithHints(i, comps, func(p *prog.Prog) bool { ncandidates++ if *flagOutput { log.Logf(1, "PROGRAM:\n%s", p.Serialize()) } + return true }) } log.Logf(0, "ncomps=%v ncandidates=%v", ncomps, ncandidates) diff --git a/tools/syz-mutate/mutate.go b/tools/syz-mutate/mutate.go index 2394ed619..101ce0739 100644 --- a/tools/syz-mutate/mutate.go +++ b/tools/syz-mutate/mutate.go @@ -89,8 +89,9 @@ func main() { if *flagHintCall != -1 { comps := make(prog.CompMap) comps.AddComp(*flagHintSrc, *flagHintCmp) - p.MutateWithHints(*flagHintCall, comps, func(p *prog.Prog) { + p.MutateWithHints(*flagHintCall, comps, func(p *prog.Prog) bool { fmt.Printf("%s\n\n", p.Serialize()) + return true }) return } else { |
