diff options
Diffstat (limited to 'compiler-rt/lib/fuzzer/FuzzerMerge.cpp')
| -rw-r--r-- | compiler-rt/lib/fuzzer/FuzzerMerge.cpp | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerMerge.cpp b/compiler-rt/lib/fuzzer/FuzzerMerge.cpp index b4f05e3b8b0..0d4971af09b 100644 --- a/compiler-rt/lib/fuzzer/FuzzerMerge.cpp +++ b/compiler-rt/lib/fuzzer/FuzzerMerge.cpp @@ -168,16 +168,6 @@ size_t Merger::Merge(const Set<uint32_t> &InitialFeatures, return AllFeatures.size() - InitialNumFeatures; } -void Merger::PrintSummary(std::ostream &OS) { - for (auto &File : Files) { - OS << std::hex; - OS << File.Name << " size: " << File.Size << " features: "; - for (auto Feature : File.Features) - OS << " " << Feature; - OS << "\n"; - } -} - Set<uint32_t> Merger::AllFeatures() const { Set<uint32_t> S; for (auto &File : Files) @@ -185,25 +175,6 @@ Set<uint32_t> Merger::AllFeatures() const { return S; } -Set<uint32_t> Merger::ParseSummary(std::istream &IS) { - std::string Line, Tmp; - Set<uint32_t> Res; - while (std::getline(IS, Line, '\n')) { - size_t N; - std::istringstream ISS1(Line); - ISS1 >> Tmp; // Name - ISS1 >> Tmp; // size: - assert(Tmp == "size:" && "Corrupt summary file"); - ISS1 >> std::hex; - ISS1 >> N; // File Size - ISS1 >> Tmp; // features: - assert(Tmp == "features:" && "Corrupt summary file"); - while (ISS1 >> std::hex >> N) - Res.insert(N); - } - return Res; -} - // Inner process. May crash if the target crashes. void Fuzzer::CrashResistantMergeInternalStep(const std::string &CFPath) { Printf("MERGE-INNER: using the control file '%s'\n", CFPath.c_str()); @@ -278,9 +249,7 @@ static void WriteNewControlFile(const std::string &CFPath, Vector<std::string> CrashResistantMerge(const Vector<std::string> &Args, const Vector<std::string> &Corpora, - const std::string &CFPath, - const char *CoverageSummaryInputPathOrNull, - const char *CoverageSummaryOutputPathOrNull) { + const std::string &CFPath) { size_t NumAttempts = 0; if (FileSize(CFPath)) { Printf("MERGE-OUTER: non-empty control file provided: '%s'\n", @@ -354,19 +323,7 @@ CrashResistantMerge(const Vector<std::string> &Args, IF.close(); Printf("MERGE-OUTER: consumed %zdMb (%zdMb rss) to parse the control file\n", M.ApproximateMemoryConsumption() >> 20, GetPeakRSSMb()); - if (CoverageSummaryOutputPathOrNull) { - Printf("MERGE-OUTER: writing coverage summary for %zd files to %s\n", - M.Files.size(), CoverageSummaryOutputPathOrNull); - std::ofstream SummaryOut(CoverageSummaryOutputPathOrNull); - M.PrintSummary(SummaryOut); - } Set<uint32_t> InitialFeatures; - if (CoverageSummaryInputPathOrNull) { - std::ifstream SummaryIn(CoverageSummaryInputPathOrNull); - InitialFeatures = M.ParseSummary(SummaryIn); - Printf("MERGE-OUTER: coverage summary loaded from %s, %zd features found\n", - CoverageSummaryInputPathOrNull, InitialFeatures.size()); - } Vector<std::string> NewFiles; size_t NumNewFeatures = M.Merge(InitialFeatures, &NewFiles); Printf("MERGE-OUTER: %zd new files with %zd new features added\n", |

