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

Jonathan Metzman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 27 12:00:47 PDT 2018


metzman added inline comments.


================
Comment at: lib/fuzzer/FuzzerMutate.cpp:23
+const double kDefaultMutationWeight = 1;
+const double kDefaultMutationStat = 1 / (100 * 1000);
 
----------------
Please add a comment to explain the significance of `100` and `1000` (frankly i don't know what the purpose is of either since we don't actually round anything).


================
Comment at: lib/fuzzer/FuzzerMutate.cpp:583
+  for (size_t i = 0; i < Mutators.size(); i++) {
+    double UsefulRatio = Mutators[i].TotalCount
+                             ? static_cast<double>(Mutators[i].UsefulCount) /
----------------
I like that you went to fix something based on comments you saw in on the review even if they weren't explicit. 
But in general it's better not to refactor unrelated code in a CL. I'll accept it though.
This assignment statement is starting to look pretty bad, please make use a regular if else instead of ternary.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D49621





More information about the llvm-commits mailing list