[fuzzer] properly annotate fallthrough, add one more entry to FAQ
authorKostya Serebryany <kcc@google.com>
Thu, 19 Feb 2015 18:21:12 +0000 (18:21 +0000)
committerKostya Serebryany <kcc@google.com>
Thu, 19 Feb 2015 18:21:12 +0000 (18:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229880 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Fuzzer/FuzzerMutate.cpp
lib/Fuzzer/README.txt

index 60d5623ada608ad6dfc1c54c2ce4ca3839b7cc7a..b28264ac8c1d2b6fe3d5d6db2bbcce043603ca67 100644 (file)
@@ -47,7 +47,7 @@ void Mutate(Unit *U, size_t MaxLen) {
       U->erase(U->begin() + rand() % U->size());
       break;
     }
-    // Fallthrough
+    [[clang::fallthrough]];
   case 1:
     if (U->size() < MaxLen) {
       U->insert(U->begin() + rand() % U->size(), RandCh());
index 1e1acbbe1dd9727666104c7ecf0ea6db62ffefcf..e4d6b4f207952e7fc926d37edc52dbf1044cd51e 100644 (file)
@@ -104,3 +104,9 @@ A.
     more) the speed benefit from the in-process fuzzer is negligible.
   * If the target library runs persistent threads (that outlive
     execution of one test) the fuzzing results will be unreliable.
+
+Q. So, what exactly this Fuzzer is good for?
+A. This Fuzzer might be a good choice for testing libraries that have relatively
+small inputs, each input takes < 1ms to run, and the library code is not expected
+to crash on invalid inputs.
+Examples: regular expression matchers, text or binary format parsers.