diff options
author | Kostya Serebryany <kcc@google.com> | 2018-06-07 01:40:20 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2018-06-07 01:40:20 +0000 |
commit | 67af99235fa24c031a0efcd074b401c66b843f0c (patch) | |
tree | c347b77e257d8ed7dc1443060a61b74e1d93b786 /compiler-rt/lib/fuzzer/FuzzerLoop.cpp | |
parent | 177b458c8a42e5edac291ab39e90012b3df63090 (diff) | |
download | bcm5719-llvm-67af99235fa24c031a0efcd074b401c66b843f0c.tar.gz bcm5719-llvm-67af99235fa24c031a0efcd074b401c66b843f0c.zip |
[libFuzzer] make the corpus elements aware of their data flow traces
llvm-svn: 334158
Diffstat (limited to 'compiler-rt/lib/fuzzer/FuzzerLoop.cpp')
-rw-r--r-- | compiler-rt/lib/fuzzer/FuzzerLoop.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerLoop.cpp b/compiler-rt/lib/fuzzer/FuzzerLoop.cpp index a195d21d38c..346f90e6ed9 100644 --- a/compiler-rt/lib/fuzzer/FuzzerLoop.cpp +++ b/compiler-rt/lib/fuzzer/FuzzerLoop.cpp @@ -469,10 +469,11 @@ bool Fuzzer::RunOne(const uint8_t *Data, size_t Size, bool MayDeleteFile, TPC.UpdateObservedPCs(); Corpus.AddToCorpus({Data, Data + Size}, NumNewFeatures, MayDeleteFile, TPC.ObservedFocusFunction(), - UniqFeatureSetTmp); + UniqFeatureSetTmp, DFT); return true; } if (II && FoundUniqFeaturesOfII && + II->DataFlowTraceForFocusFunction.empty() && FoundUniqFeaturesOfII == II->UniqFeatureSet.size() && II->U.size() > Size) { Corpus.Replace(II, {Data, Data + Size}); @@ -739,6 +740,9 @@ void Fuzzer::ReadAndExecuteSeedCorpora(const Vector<std::string> &CorpusDirs) { if (!Options.FocusFunction.empty()) Printf("INFO: %zd/%zd inputs touch the focus function\n", Corpus.NumInputsThatTouchFocusFunction(), Corpus.size()); + if (!Options.DataFlowTrace.empty()) + Printf("INFO: %zd/%zd inputs have the Data Flow Trace\n", + Corpus.NumInputsWithDataFlowTrace(), Corpus.size()); if (Corpus.empty() && Options.MaxNumberOfRuns) { Printf("ERROR: no interesting inputs were found. " @@ -749,6 +753,7 @@ void Fuzzer::ReadAndExecuteSeedCorpora(const Vector<std::string> &CorpusDirs) { void Fuzzer::Loop(const Vector<std::string> &CorpusDirs) { ReadAndExecuteSeedCorpora(CorpusDirs); + DFT.Clear(); // No need for DFT any more. TPC.SetPrintNewPCs(Options.PrintNewCovPcs); TPC.SetPrintNewFuncs(Options.PrintNewCovFuncs); system_clock::time_point LastCorpusReload = system_clock::now(); |