[PATCH] D49621: [libFuzzer] Initial implementation of weighted mutation leveraging during runtime.
Max Moroz via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 31 16:21:46 PDT 2018
Dor1s added inline comments.
================
Comment at: lib/fuzzer/FuzzerMutate.cpp:595
+ for (size_t i = 0; i < Stats.size(); i++)
+ Stats[i] = (Mutators[i].UsefulCount * 1.0) / Mutators[i].TotalCount;
+}
----------------
kodewilliams wrote:
> Dor1s wrote:
> > here and on line 603, what's the point of multiplying by 1.0?
> Both UsefulCount and TotalCount are uint64_t but Stats is a vector of doubles, so I multiply by 1.0 to make sure it gets calculated as double.
It's an obscure way to cast a value to another type. Please use `static_cast<double>(Mutators[i].UsefulCount)` instead.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D49621
More information about the llvm-commits
mailing list