about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-01-10 13:12:44 +0100
committervan Hauser <vh@thc.org>2021-01-10 13:12:44 +0100
commitdc81f681c9cb0af66ae6f820ed421a2b7100a404 (patch)
treeba207d7d24af308172c4f605d6d4dfb7b3385288
parent20a47cb23e9c6406b4a6c0c94783667a8b06316a (diff)
downloadafl++-dc81f681c9cb0af66ae6f820ed421a2b7100a404.tar.gz
fix weight calc, thanks to Marcel
-rw-r--r--src/afl-fuzz-queue.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/afl-fuzz-queue.c b/src/afl-fuzz-queue.c
index 99f564e9..66938635 100644
--- a/src/afl-fuzz-queue.c
+++ b/src/afl-fuzz-queue.c
@@ -57,7 +57,7 @@ double compute_weight(afl_state_t *afl, struct queue_entry *q,
 
   if (likely(afl->schedule < RARE)) { weight *= (avg_exec_us / q->exec_us); }
   weight *= (log(q->bitmap_size) / avg_bitmap_size);
-  weight *= (log(q->tc_ref) / avg_top_size);
+  weight *= (1 + (q->tc_ref / avg_top_size));
   if (unlikely(q->favored)) weight *= 5;
 
   return weight;
@@ -104,7 +104,7 @@ void create_alias_table(afl_state_t *afl) {
 
         avg_exec_us += q->exec_us;
         avg_bitmap_size += log(q->bitmap_size);
-        avg_top_size += log(q->tc_ref);
+        avg_top_size += q->tc_ref;
         ++active;
 
       }