[PATCH] D47271: [libFuzzer] Don't complain about lack of interesting inputs when -runs=0.

Max Moroz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 23 11:08:53 PDT 2018


Dor1s created this revision.
Dor1s added a reviewer: kcc.
Herald added subscribers: Sanitizers, delcypher.

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.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D47271

Files:
  lib/fuzzer/FuzzerLoop.cpp


Index: lib/fuzzer/FuzzerLoop.cpp
===================================================================
--- lib/fuzzer/FuzzerLoop.cpp
+++ lib/fuzzer/FuzzerLoop.cpp
@@ -743,7 +743,7 @@
     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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47271.148253.patch
Type: text/x-patch
Size: 530 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180523/bbe34f84/attachment.bin>


More information about the llvm-commits mailing list