[PATCH] D36275: Implement llvm-isel-fuzzer for fuzzing instruction selection

Kostya Serebryany via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 3 13:08:16 PDT 2017


kcc added inline comments.


================
Comment at: tools/llvm-isel-fuzzer/llvm-isel-fuzzer.cpp:111
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
+  if (Size == 0 || (Size == 1 && *Data == '\n'))
+    // We get bogus data given an empty corpus - ignore it.
----------------
You assume that libFuzzer will feed "\n" as a dummy input. 
But this is not part of the contract. 


================
Comment at: tools/llvm-isel-fuzzer/llvm-isel-fuzzer.cpp:117
+    errs() << "Mutator failed to make progress.\n";
+    return 1;
+  }
----------------
currently the non-zero return value for LLVMFuzzerTestOneInput will call an error in libFuzzer.
Also, an ideal fuzz target must tolerate any kind of input, even if we never expect to see it. 


Repository:
  rL LLVM

https://reviews.llvm.org/D36275





More information about the llvm-commits mailing list