about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2023-09-06 12:00:16 +0000
committerGitHub <noreply@github.com>2023-09-06 12:00:16 +0000
commit2f1043bbdf62da71fd014d3ad3e94d063cdaeb45 (patch)
tree2fb99de777dcf45556887c261943c823bda06b6a
parent167fb7748d081af4b85f2fd8c72018f6487450a2 (diff)
parentd83edc6175b8a4aa9f1a89c118b0ecf93dcef31c (diff)
downloadafl++-2f1043bbdf62da71fd014d3ad3e94d063cdaeb45.tar.gz
Merge pull request #1851 from chinggg/cmp_fuzz_p2
Skip calculating top_rated_fuzz_p2 with FAST schedule
-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]);