diff options
author | van Hauser <vh@thc.org> | 2020-05-06 11:51:28 +0200 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-05-06 11:51:28 +0200 |
commit | 80ddb484deb82aefc9ba35c766ffca313d74e377 (patch) | |
tree | b0aa9e3ecacc75550d63d1d66d6d098219958e2b /llvm_mode/afl-llvm-common.cc | |
parent | b4e3f22259397629f1e2a66dd17c36d19c4ecb0d (diff) | |
download | afl++-80ddb484deb82aefc9ba35c766ffca313d74e377.tar.gz |
added InsTrimLTO :-)
Diffstat (limited to 'llvm_mode/afl-llvm-common.cc')
-rw-r--r-- | llvm_mode/afl-llvm-common.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm_mode/afl-llvm-common.cc b/llvm_mode/afl-llvm-common.cc index 04dd9475..c62b4c14 100644 --- a/llvm_mode/afl-llvm-common.cc +++ b/llvm_mode/afl-llvm-common.cc @@ -201,3 +201,20 @@ bool isInWhitelist(llvm::Function *F) { } +// Calculate the number of average collisions that would occur if all +// location IDs would be assigned randomly (like normal afl/afl++). +// This uses the "balls in bins" algorithm. +unsigned long long int calculateCollisions(uint32_t edges) { + + double bins = MAP_SIZE; + double balls = edges; + double step1 = 1 - (1 / bins); + double step2 = pow(step1, balls); + double step3 = bins * step2; + double step4 = round(step3); + unsigned long long int empty = step4; + unsigned long long int collisions = edges - (MAP_SIZE - empty); + return collisions; + +} + |