[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:14:06 PDT 2018


Dor1s updated this revision to Diff 148254.
Dor1s added a comment.

Stop being stupid and write conditions right (i.e. remove "!")


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D47271

Files:
  lib/fuzzer/FuzzerLoop.cpp
  test/fuzzer/not-instrumented.test


Index: test/fuzzer/not-instrumented.test
===================================================================
--- test/fuzzer/not-instrumented.test
+++ test/fuzzer/not-instrumented.test
@@ -1,4 +1,4 @@
 RUN: %cpp_compiler %S/NotinstrumentedTest.cpp -fsanitize-coverage=0 -o %t-NotinstrumentedTest-NoCoverage
-RUN: not %run %t-NotinstrumentedTest-NoCoverage 2>&1 | FileCheck %s --check-prefix=NO_COVERAGE
+RUN: not %run %t-NotinstrumentedTest-NoCoverage -runs=1 2>&1 | FileCheck %s --check-prefix=NO_COVERAGE
 
 NO_COVERAGE: ERROR: no interesting inputs were found. Is the code instrumented for coverage? Exiting
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.148254.patch
Type: text/x-patch
Size: 1140 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180523/b7459b09/attachment.bin>


More information about the llvm-commits mailing list