[PATCH] D49621: [libFuzzer] Initial implementation of weighted mutation leveraging during runtime.
Max Moroz via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 2 13:52:12 PDT 2018
Dor1s added inline comments.
================
Comment at: lib/fuzzer/FuzzerMutate.cpp:601
+ double SumOfStats = std::accumulate(Stats.begin(), Stats.end(), 0.0);
+ if (!SumOfStats) return;
+ Distribution = std::discrete_distribution<size_t>(Stats.begin(), Stats.end());
----------------
morehouse wrote:
> `SumOfStats` doesn't need to be calculated.
Matt, we needed `SumOfStats` to be non zero to ensure that we have at least some distribution. Until that moment is reached, we should be using the initial weights. I like this simplification though, but in that case we'll have to initialize `UsefulCount` with `1`, so that initial `Stats` will be `1 / 1` for every mutation.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D49621
More information about the llvm-commits
mailing list