about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorchinggg <24590067+chinggg@users.noreply.github.com>2023-09-03 19:20:44 +0800
committerchinggg <24590067+chinggg@users.noreply.github.com>2023-09-03 19:20:44 +0800
commitd83edc6175b8a4aa9f1a89c118b0ecf93dcef31c (patch)
tree9303f8697df5f1fbb9830b19e56efed2b2965e3a /src
parent3bae404733e27b3ec7769ad6d5d997dcd9ec6fa3 (diff)
downloadafl++-d83edc6175b8a4aa9f1a89c118b0ecf93dcef31c.tar.gz
Skip calculating top_rated_fuzz_p2 with FAST schedule
when FAST schedule is used, fuzz_p2 is already set to 0 so `fuzz_p2 > top_rated_fuzz_p2`
never happens, just set top_rated_fuzz_p2 to 0 to reduce calculation
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz-queue.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/afl-fuzz-queue.c b/src/afl-fuzz-queue.c
index 14ba1ace..793bec90 100644
--- a/src/afl-fuzz-queue.c
+++ b/src/afl-fuzz-queue.c
@@ -737,7 +737,11 @@ void update_bitmap_score(afl_state_t *afl, struct queue_entry *q) {
         u64 top_rated_fav_factor;
         u64 top_rated_fuzz_p2;
 
-        if (likely(afl->schedule >= FAST && afl->schedule <= RARE)) {
+        if (likely(afl->schedule >= FAST && afl->schedule < RARE)) {
+
+          top_rated_fuzz_p2 = 0;  // Skip the fuzz_p2 comparison
+
+        } else if (unlikely(afl->schedule == RARE)) {
 
           top_rated_fuzz_p2 =
               next_pow2(afl->n_fuzz[afl->top_rated[i]->n_fuzz_entry]);