[llvm] r259454 - [libFuzzer] fail if the corpus dir does not exist

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 18:07:26 PST 2016


Author: kcc
Date: Mon Feb  1 20:07:26 2016
New Revision: 259454

URL: http://llvm.org/viewvc/llvm-project?rev=259454&view=rev
Log:
[libFuzzer] fail if the corpus dir does not exist

Modified:
    llvm/trunk/lib/Fuzzer/FuzzerIO.cpp
    llvm/trunk/lib/Fuzzer/test/fuzzer.test

Modified: llvm/trunk/lib/Fuzzer/FuzzerIO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerIO.cpp?rev=259454&r1=259453&r2=259454&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerIO.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerIO.cpp Mon Feb  1 20:07:26 2016
@@ -32,7 +32,7 @@ static std::vector<std::string> ListFile
   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());

Modified: llvm/trunk/lib/Fuzzer/test/fuzzer.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/fuzzer.test?rev=259454&r1=259453&r2=259454&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/fuzzer.test (original)
+++ llvm/trunk/lib/Fuzzer/test/fuzzer.test Mon Feb  1 20:07:26 2016
@@ -42,3 +42,6 @@ RUN: not LLVMFuzzer-InitializeTest 2>&1
 
 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




More information about the llvm-commits mailing list