aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-08-07 15:16:35 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-08-07 18:47:26 +0000
commit7013cb0d7d7b78bb0160c45d13a8d7d472835513 (patch)
tree8955241dedf178b338a673f4254d652a0b615f01 /pkg/csource
parent58a20e60bf226392db3d88eb36503b9cc711a153 (diff)
prog: replace MinimizeParams with MinimizeMode
All callers shouldn't control lots of internal details of minimization (if we have more params, that's just more variations to test, and we don't have more, params is just a more convoluted way to say if we minimize for corpus or a crash). 2 bools also allow to express 4 options, but only 3 make sense. Also when I see MinimizeParams{} in the code, it's unclear what it means. Replace params with mode. And potentially "crash" minimization is not "light", it's just different. E.g. we can simplify int arguments for reproducers (esp in snapshot mode), but we don't need that for corpus.
Diffstat (limited to 'pkg/csource')
-rw-r--r--pkg/csource/csource_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/csource/csource_test.go b/pkg/csource/csource_test.go
index 7d67927a3..c97757d01 100644
--- a/pkg/csource/csource_test.go
+++ b/pkg/csource/csource_test.go
@@ -91,7 +91,7 @@ func testTarget(t *testing.T, target *prog.Target, full bool) {
opts = allOptionsSingle(target.OS)
opts = append(opts, ExecutorOpts)
} else {
- minimized, _ := prog.Minimize(syzProg, -1, prog.MinimizeParams{}, func(p *prog.Prog, call int) bool {
+ minimized, _ := prog.Minimize(syzProg, -1, prog.MinimizeCorpus, func(p *prog.Prog, call int) bool {
return len(p.Calls) == len(syzProg.Calls)
})
p.Calls = append(p.Calls, minimized.Calls...)