mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-27 13:40:30 +00:00
[libFuzzer] don't timeout when loading the corpus. Be a bit more verbose when loading large corpus.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261143 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
763454153f
commit
73b0e08885
@ -86,9 +86,13 @@ void WriteToFile(const Unit &U, const std::string &Path) {
|
||||
void ReadDirToVectorOfUnits(const char *Path, std::vector<Unit> *V,
|
||||
long *Epoch) {
|
||||
long E = Epoch ? *Epoch : 0;
|
||||
for (auto &X : ListFilesInDir(Path, Epoch)) {
|
||||
auto Files = ListFilesInDir(Path, Epoch);
|
||||
for (size_t i = 0; i < Files.size(); i++) {
|
||||
auto &X = Files[i];
|
||||
auto FilePath = DirPlusFile(Path, X);
|
||||
if (Epoch && GetEpoch(FilePath) < E) continue;
|
||||
if ((i % 1000) == 0 && i)
|
||||
Printf("Loaded %zd/%zd files from %s\n", i, Files.size(), Path);
|
||||
V->push_back(FileToVector(FilePath));
|
||||
}
|
||||
}
|
||||
|
@ -101,6 +101,8 @@ void Fuzzer::StaticAlarmCallback() {
|
||||
|
||||
void Fuzzer::AlarmCallback() {
|
||||
assert(Options.UnitTimeoutSec > 0);
|
||||
if (!CurrentUnitSize)
|
||||
return; // We have not started running units yet.
|
||||
size_t Seconds =
|
||||
duration_cast<seconds>(system_clock::now() - UnitStartTime).count();
|
||||
if (Seconds == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user