[PATCH] D40565: [LibFuzzer] Improve comments on `CounterToFeature()` function.
Dan Liew via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 28 09:42:27 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL319190: [LibFuzzer] Improve comments on `CounterToFeature()` function. (authored by delcypher).
Changed prior to commit:
https://reviews.llvm.org/D40565?vs=124593&id=124595#toc
Repository:
rL LLVM
https://reviews.llvm.org/D40565
Files:
compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.h
Index: compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.h
===================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.h
+++ compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.h
@@ -196,9 +196,20 @@
Handle8bitCounter(FirstFeature, P - Begin, V);
}
-// Given a non-zero Counters returns a number in [0,7].
+// Given a non-zero Counter returns a number in the range [0,7].
template<class T>
unsigned CounterToFeature(T Counter) {
+ // Returns a feature number by placing Counters into buckets as illustrated
+ // below.
+ //
+ // Counter bucket: [1] [2] [3] [4-7] [8-15] [16-31] [32-127] [128+]
+ // Feature number: 0 1 2 3 4 5 6 7
+ //
+ // This is a heuristic taken from AFL (see
+ // http://lcamtuf.coredump.cx/afl/technical_details.txt).
+ //
+ // This implementation may change in the future so clients should
+ // not rely on it.
assert(Counter);
unsigned Bit = 0;
/**/ if (Counter >= 128) Bit = 7;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40565.124595.patch
Type: text/x-patch
Size: 1033 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171128/1c99b330/attachment.bin>
More information about the llvm-commits
mailing list