summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerIO.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerIO.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerIO.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerIO.cpp b/llvm/lib/Fuzzer/FuzzerIO.cpp
index b6ffb752de3..4bb2df5d71a 100644
--- a/llvm/lib/Fuzzer/FuzzerIO.cpp
+++ b/llvm/lib/Fuzzer/FuzzerIO.cpp
@@ -49,6 +49,10 @@ static std::vector<std::string> ListFilesInDir(const std::string &Dir,
Unit FileToVector(const std::string &Path) {
std::ifstream T(Path);
+ if (!T) {
+ Printf("No such directory: %s; exiting\n", Path.c_str());
+ exit(1);
+ }
return Unit((std::istreambuf_iterator<char>(T)),
std::istreambuf_iterator<char>());
}
OpenPOWER on IntegriCloud