[compiler-rt] r333116 - [libFuzzer] Don't complain about lack of interesting inputs when -runs=0.

Max Moroz via llvm-commits llvm-commits at lists.llvm.org
Wed May 23 12:42:30 PDT 2018


Author: dor1s
Date: Wed May 23 12:42:30 2018
New Revision: 333116

URL: http://llvm.org/viewvc/llvm-project?rev=333116&view=rev
Log:
[libFuzzer] Don't complain about lack of interesting inputs when -runs=0.

Summary:
The most common usecase for -runs=0 is for generating code coverage
over some corpus. Coverage reports based on sancov are about to be deprecated,
which means some external coverage solution will be used, e.g. Clang source
based code coverage, which does not use any sancov instrumentations and thus
libFuzzer would consider any input to be not interesting in that case.

Reviewers: kcc

Reviewed By: kcc

Subscribers: alex, delcypher, #sanitizers, llvm-commits

Differential Revision: https://reviews.llvm.org/D47271

Modified:
    compiler-rt/trunk/lib/fuzzer/FuzzerLoop.cpp

Modified: compiler-rt/trunk/lib/fuzzer/FuzzerLoop.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerLoop.cpp?rev=333116&r1=333115&r2=333116&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerLoop.cpp (original)
+++ compiler-rt/trunk/lib/fuzzer/FuzzerLoop.cpp Wed May 23 12:42:30 2018
@@ -743,7 +743,7 @@ void Fuzzer::ReadAndExecuteSeedCorpora(c
     Printf("INFO: %zd/%zd inputs touch the focus function\n",
            Corpus.NumInputsThatTouchFocusFunction(), Corpus.size());
 
-  if (Corpus.empty()) {
+  if (Corpus.empty() && Options.MaxNumberOfRuns) {
     Printf("ERROR: no interesting inputs were found. "
            "Is the code instrumented for coverage? Exiting.\n");
     exit(1);




More information about the llvm-commits mailing list