diff options
author | van Hauser <vh@thc.org> | 2023-04-27 17:57:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-27 17:57:22 +0200 |
commit | a2daef29f9c323c0a6a7a64013aadb79ffd3e534 (patch) | |
tree | 5d43bf4775236130666e04b4e0d9a8a16e75a298 /include | |
parent | e983e2e9cfb9e4c8489dc35f28bca502ec241c27 (diff) | |
download | afl++-a2daef29f9c323c0a6a7a64013aadb79ffd3e534.tar.gz |
slightly different weighting algo (#1719)
* better seed selection * slightly different weighting calculation * remove unnecessary memset
Diffstat (limited to 'include')
-rw-r--r-- | include/afl-fuzz.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h index 831a0dbc..8fb7ecb1 100644 --- a/include/afl-fuzz.h +++ b/include/afl-fuzz.h @@ -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)) { |