aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-12-11 10:23:42 +0100
committerGitHub <noreply@github.com>2020-12-11 10:23:42 +0100
commit1a3c9bc36dc5690276c24dadecf2fb9adb02c0a9 (patch)
tree915c8daf2c02fd231726c8551c30fe39fdc677c8 /src
parent161c80014ec11e8ae4338da34428c20dcbe03962 (diff)
parente5c50037d5029e995c057ae50ece6b1ee87db106 (diff)
downloadafl++-1a3c9bc36dc5690276c24dadecf2fb9adb02c0a9.tar.gz
Merge pull request #627 from AFLplusplus/other_weight
Other weight
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz-queue.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/afl-fuzz-queue.c b/src/afl-fuzz-queue.c
index 071e4a4c..84092ff8 100644
--- a/src/afl-fuzz-queue.c
+++ b/src/afl-fuzz-queue.c
@@ -45,8 +45,15 @@ inline u32 select_next_queue_entry(afl_state_t *afl) {
double compute_weight(afl_state_t *afl, struct queue_entry *q,
double avg_exec_us, double avg_bitmap_size) {
- u32 hits = afl->n_fuzz[q->n_fuzz_entry];
- if (hits == 0) hits = 1;
+ u32 hits;
+
+ if (likely(afl->schedule >= FAST && afl->schedule < RARE)) {
+
+ hits = afl->n_fuzz[q->n_fuzz_entry];
+ if (hits == 0) { hits = 1; }
+
+ } else { hits = 1; }
+
double weight = 1.0;
weight *= avg_exec_us / q->exec_us;
@@ -83,7 +90,7 @@ void create_alias_table(afl_state_t *afl) {
memset((void *)afl->alias_table, 0, n * sizeof(u32));
memset((void *)afl->alias_probability, 0, n * sizeof(double));
- if (likely(afl->schedule >= FAST && afl->schedule <= RARE)) {
+ if (likely(afl->schedule < RARE)) {
double avg_exec_us = 0.0;
double avg_bitmap_size = 0.0;