diff options
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerLoop.cpp')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerLoop.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerLoop.cpp b/llvm/lib/Fuzzer/FuzzerLoop.cpp index 32e5536c42f..a8f640307fc 100644 --- a/llvm/lib/Fuzzer/FuzzerLoop.cpp +++ b/llvm/lib/Fuzzer/FuzzerLoop.cpp @@ -479,6 +479,9 @@ size_t Fuzzer::RunOne(const uint8_t *Data, size_t Size) { Res = 1; } + if (Res && Options.UseCmp) + TPC.ProcessTORC(MD.GetTraceCmpDictionary(), CurrentUnitData, Size); + CheckExitOnSrcPos(); auto TimeOfUnit = duration_cast<seconds>(UnitStopTime - UnitStartTime).count(); @@ -513,6 +516,8 @@ void Fuzzer::ExecuteCallback(const uint8_t *Data, size_t Size) { UnitStartTime = system_clock::now(); ResetCounters(); // Reset coverage right before the callback. TPC.ResetMaps(); + if (Options.UseCmp) + TPC.ResetTORC(); if (Options.UseCounters) TPC.ResetGuards(); int Res = CB(DataCopy, Size); @@ -594,15 +599,22 @@ UnitVector Fuzzer::FindExtraUnits(const UnitVector &Initial, ShuffleCorpus(&Res); TPC.ResetMaps(); TPC.ResetGuards(); + Corpus.ResetFeatureSet(); ResetCoverage(); - for (auto &U : Initial) + for (auto &U : Initial) { + TPC.ResetMaps(); + TPC.ResetGuards(); RunOne(U); + } Tmp.clear(); - for (auto &U : Res) + for (auto &U : Res) { + TPC.ResetMaps(); + TPC.ResetGuards(); if (RunOne(U)) Tmp.push_back(U); + } char Stat[7] = "MIN "; Stat[3] = '0' + Iter; |