diff options
author | van Hauser <vh@thc.org> | 2023-04-17 10:26:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-17 10:26:33 +0200 |
commit | a326c23210dc2ace37bf1cadcc4521cf5d0b58cb (patch) | |
tree | 5e97dc274212181cd0117057492bce84809e1a4d /src/afl-fuzz-queue.c | |
parent | 4f2d9eeaaa6b702ef28eb883f9000321eaf1fe9b (diff) | |
parent | 7f734c96d187312868178e8ead95dc103c557c1f (diff) | |
download | afl++-a326c23210dc2ace37bf1cadcc4521cf5d0b58cb.tar.gz |
Merge pull request #1706 from AFLplusplus/dev 4.06c
push to stable, 4.06c release
Diffstat (limited to 'src/afl-fuzz-queue.c')
-rw-r--r-- | src/afl-fuzz-queue.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/afl-fuzz-queue.c b/src/afl-fuzz-queue.c index 6fc3c743..8ad7cd97 100644 --- a/src/afl-fuzz-queue.c +++ b/src/afl-fuzz-queue.c @@ -149,21 +149,15 @@ void create_alias_table(afl_state_t *afl) { } - if (unlikely(afl->prefer_new) && afl->queued_discovered) { + if (unlikely(afl->schedule == MMOPT) && afl->queued_discovered) { - double avg_weight = sum / active; + u32 cnt = afl->queued_discovered >= 5 ? 5 : afl->queued_discovered; - for (i = n - afl->queued_discovered; i < n; i++) { + for (i = n - cnt; i < n; i++) { struct queue_entry *q = afl->queue_buf[i]; - if (likely(!q->disabled) && q->weight > avg_weight) { - - double prev_weight = q->weight; - q->weight *= (2.0 * (i / n)); - sum += (q->weight - prev_weight); - - } + if (likely(!q->disabled)) { q->weight *= 2.0; } } |