[PATCH] D16487: Use std::piecewise_constant_distribution instead of ad-hoc binary search.

Ivan Krasin via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 14:32:05 PST 2016


krasin added inline comments.

================
Comment at: lib/Fuzzer/FuzzerInternal.h:203-206
@@ -202,3 +202,6 @@
   Fuzzer(UserSuppliedFuzzer &USF, FuzzingOptions Options);
-  void AddToCorpus(const Unit &U) { Corpus.push_back(U); }
+  void AddToCorpus(const Unit &U) {
+    Corpus.push_back(U);
+    UpdateCorpusDistribution();
+  }
   size_t ChooseUnitIdxToMutate();
----------------
Done.

================
Comment at: lib/Fuzzer/FuzzerInternal.h:289
@@ -282,1 +288,3 @@
 
+  // TODO(krasin): remove GetRand from UserSuppliedFuzzer,
+  // and fully rely on the generator and the seed.
----------------
Done. As discussed offline, the way to go is to expose the generator to the user supplied fuzzer, so that they could seed their internal PRNG, if needed.


http://reviews.llvm.org/D16487





More information about the llvm-commits mailing list