mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
[fuzzer] add option -save_minimized_corpus
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227395 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
#include <dirent.h>
|
||||
namespace fuzzer {
|
||||
|
||||
std::vector<std::string> ListFilesInDir(const std::string &Dir) {
|
||||
static std::vector<std::string> ListFilesInDir(const std::string &Dir) {
|
||||
std::vector<std::string> V;
|
||||
DIR *D = opendir(Dir.c_str());
|
||||
if (!D) return V;
|
||||
@@ -38,7 +38,12 @@ void WriteToFile(const Unit &U, const std::string &Path) {
|
||||
|
||||
void ReadDirToVectorOfUnits(const char *Path, std::vector<Unit> *V) {
|
||||
for (auto &X : ListFilesInDir(Path))
|
||||
V->push_back(FileToVector(std::string(Path) + "/" + X));
|
||||
V->push_back(FileToVector(DirPlusFile(Path, X)));
|
||||
}
|
||||
|
||||
std::string DirPlusFile(const std::string &DirPath,
|
||||
const std::string &FileName) {
|
||||
return DirPath + "/" + FileName;
|
||||
}
|
||||
|
||||
} // namespace fuzzer
|
||||
|
Reference in New Issue
Block a user