[llvm] r229880 - [fuzzer] properly annotate fallthrough, add one more entry to FAQ

Kostya Serebryany kcc at google.com
Thu Feb 19 10:21:12 PST 2015


Author: kcc
Date: Thu Feb 19 12:21:12 2015
New Revision: 229880

URL: http://llvm.org/viewvc/llvm-project?rev=229880&view=rev
Log:
[fuzzer] properly annotate fallthrough, add one more entry to FAQ

Modified:
    llvm/trunk/lib/Fuzzer/FuzzerMutate.cpp
    llvm/trunk/lib/Fuzzer/README.txt

Modified: llvm/trunk/lib/Fuzzer/FuzzerMutate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerMutate.cpp?rev=229880&r1=229879&r2=229880&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerMutate.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerMutate.cpp Thu Feb 19 12:21:12 2015
@@ -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());

Modified: llvm/trunk/lib/Fuzzer/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/README.txt?rev=229880&r1=229879&r2=229880&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/README.txt (original)
+++ llvm/trunk/lib/Fuzzer/README.txt Thu Feb 19 12:21:12 2015
@@ -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.





More information about the llvm-commits mailing list