F.ShuffleAndMinimize();
if (Flags.save_minimized_corpus)
F.SaveCorpus();
- F.Loop(Flags.iterations < 0 ? INT_MAX : Flags.iterations);
+ F.Loop();
if (Flags.verbosity)
Printf("Done %d runs in %zd second(s)\n", F.getTotalNumberOfRuns(),
F.secondsSinceProcessStartUp());
//===----------------------------------------------------------------------===//
FUZZER_FLAG_INT(verbosity, 1, "Verbosity level.")
FUZZER_FLAG_INT(seed, 0, "Random seed. If 0, seed is generated.")
-FUZZER_FLAG_INT(iterations, -1,
- "Number of iterations of the fuzzer internal loop"
- " (-1 for infinite iterations).")
FUZZER_FLAG_INT(runs, -1,
"Number of individual test runs (-1 for infinite runs).")
FUZZER_FLAG_INT(max_len, 64, "Maximum length of the test input.")
};
Fuzzer(UserSuppliedFuzzer &USF, FuzzingOptions Options);
void AddToCorpus(const Unit &U) { Corpus.push_back(U); }
- void Loop(size_t NumIterations);
+ void Loop();
void ShuffleAndMinimize();
void InitializeTraceState();
size_t CorpusSize() const { return Corpus.size(); }
}
}
-void Fuzzer::Loop(size_t NumIterations) {
+void Fuzzer::Loop() {
for (auto &U: Options.Dictionary)
USF.GetMD().AddWordToDictionary(U.data(), U.size());
- for (size_t i = 1; i <= NumIterations; i++) {
+ while (true) {
for (size_t J1 = 0; J1 < Corpus.size(); J1++) {
SyncCorpus();
RereadOutputCorpus();