diff options
author | Kostya Serebryany <kcc@google.com> | 2016-02-02 02:07:26 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2016-02-02 02:07:26 +0000 |
commit | 078e984d8d8f05a525c3322a9adf49857d5b5f83 (patch) | |
tree | 37c82dbb3dcf03a7fa055458d74620634a868546 | |
parent | e67b402e4544dd6837db8f5b9cdaff3f60fb34c9 (diff) | |
download | bcm5719-llvm-078e984d8d8f05a525c3322a9adf49857d5b5f83.tar.gz bcm5719-llvm-078e984d8d8f05a525c3322a9adf49857d5b5f83.zip |
[libFuzzer] fail if the corpus dir does not exist
llvm-svn: 259454
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerIO.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Fuzzer/test/fuzzer.test | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerIO.cpp b/llvm/lib/Fuzzer/FuzzerIO.cpp index 043fad396d5..cc65876f241 100644 --- a/llvm/lib/Fuzzer/FuzzerIO.cpp +++ b/llvm/lib/Fuzzer/FuzzerIO.cpp @@ -32,7 +32,7 @@ static std::vector<std::string> ListFilesInDir(const std::string &Dir, std::vector<std::string> V; if (Epoch) { auto E = GetEpoch(Dir); - if (*Epoch >= E) return V; + if (E && *Epoch >= E) return V; *Epoch = E; } DIR *D = opendir(Dir.c_str()); diff --git a/llvm/lib/Fuzzer/test/fuzzer.test b/llvm/lib/Fuzzer/test/fuzzer.test index 5754058cf69..86ef32a2af3 100644 --- a/llvm/lib/Fuzzer/test/fuzzer.test +++ b/llvm/lib/Fuzzer/test/fuzzer.test @@ -42,3 +42,6 @@ RUN: not LLVMFuzzer-InitializeTest 2>&1 | FileCheck %s RUN: LLVMFuzzer-SimpleCmpTest -seed=-1 -runs=0 2>&1 | FileCheck %s --check-prefix=CHECK_SEED_MINUS_ONE CHECK_SEED_MINUS_ONE: Seed: 4294967295 + +RUN: not LLVMFuzzer-SimpleTest NONEXISTENT_DIR 2>&1 | FileCheck %s --check-prefix=NONEXISTENT_DIR +NONEXISTENT_DIR: No such directory: NONEXISTENT_DIR; exiting |