[libFuzzer] don't reload the corpus more than once every second

llvm-svn: 254824
This commit is contained in:
Kostya Serebryany 2015-12-05 02:09:22 +00:00
parent 20a7c0b0dd
commit d2117b7607

View File

@ -468,10 +468,15 @@ void Fuzzer::Drill() {
}
void Fuzzer::Loop() {
system_clock::time_point LastCorpusReload = system_clock::now();
while (true) {
size_t J1 = ChooseUnitIdxToMutate();;
SyncCorpus();
RereadOutputCorpus();
auto Now = system_clock::now();
if (duration_cast<seconds>(Now - LastCorpusReload).count()) {
RereadOutputCorpus();
LastCorpusReload = Now;
}
if (TotalNumberOfRuns >= Options.MaxNumberOfRuns)
break;
if (Options.MaxTotalTimeSec > 0 &&