diff options
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerMerge.cpp')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerMerge.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerMerge.cpp b/llvm/lib/Fuzzer/FuzzerMerge.cpp index b3d46435fcd..9e559115680 100644 --- a/llvm/lib/Fuzzer/FuzzerMerge.cpp +++ b/llvm/lib/Fuzzer/FuzzerMerge.cpp @@ -229,6 +229,11 @@ void Fuzzer::CrashResistantMerge(const std::vector<std::string> &Args, ControlFile << NumFilesInFirstCorpus << "\n"; for (auto &Path: AllFiles) ControlFile << Path << "\n"; + if (!ControlFile) { + Printf("MERGE-OUTER: failed to write to the control file: %s\n", + CFPath.c_str()); + exit(1); + } ControlFile.close(); // Execute the inner process untill it passes. @@ -246,6 +251,9 @@ void Fuzzer::CrashResistantMerge(const std::vector<std::string> &Args, // Read the control file and do the merge. Merger M; std::ifstream IF(CFPath); + IF.seekg(0, IF.end); + Printf("MERGE-OUTER: the control file has %zd bytes\n", (size_t)IF.tellg()); + IF.seekg(0, IF.beg); M.ParseOrExit(IF, true); IF.close(); std::vector<std::string> NewFiles; |