[PATCH] D49621: [libFuzzer] Initial implementation of weighted mutation leveraging during runtime.

Max Moroz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 1 16:14:29 PDT 2018


Dor1s added a comment.

Left a couple minor comments. Looks good otherwise. Still not happy with the test, but can't think of anything better so far.

Matt, please take a look when you get a change.



================
Comment at: lib/fuzzer/FuzzerMutate.cpp:599
+void MutationDispatcher::UpdateDistribution() {
+  Vector<double> Weights;
+  Weights.resize(Mutators.size(), 1.0);
----------------
This variable is not needed until line 605. And may be not needed at all if we do an early return on line 603. Please declare it between lines 603 and 605.


================
Comment at: lib/fuzzer/FuzzerMutate.cpp:600
+  Vector<double> Weights;
+  Weights.resize(Mutators.size(), 1.0);
+  UpdateMutationStats();
----------------
We don't need to do this, just pass `Mutators.size()`to constructor of `Vector<double> Weights`. Default weight should be 0, so `Vector<double> Weights(Mutators.size());` would be enough


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D49621





More information about the llvm-commits mailing list