slightly different weighting algo (#1719)

* better seed selection

* slightly different weighting calculation

* remove unnecessary memset
This commit is contained in:
van Hauser
2023-04-27 17:57:22 +02:00
committed by GitHub
parent e983e2e9cf
commit a2daef29f9
2 changed files with 65 additions and 31 deletions

View File

@ -1223,7 +1223,7 @@ double rand_next_percent(afl_state_t *afl);
static inline u32 rand_below(afl_state_t *afl, u32 limit) {
if (limit <= 1) return 0;
if (unlikely(limit <= 1)) return 0;
/* The boundary not being necessarily a power of 2,
we need to ensure the result uniformity. */
@ -1256,7 +1256,7 @@ static inline u32 rand_below(afl_state_t *afl, u32 limit) {
expand havoc mode */
static inline u32 rand_below_datalen(afl_state_t *afl, u32 limit) {
if (limit <= 1) return 0;
if (unlikely(limit <= 1)) return 0;
switch (rand_below(afl, 3)) {