diff options
author | van Hauser <vh@thc.org> | 2022-08-25 15:56:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-25 15:56:36 +0200 |
commit | 413e68ab6d588b12976c5ff34e1a27eae48c26d8 (patch) | |
tree | 24ac9dc2eb3bf5c3f114e9e0abb52729f893b8ed /src/afl-fuzz-queue.c | |
parent | 3e2986dd78dbc45035b47a34eedd7dd1b9a4d0b3 (diff) | |
parent | eb5a914ef670d43cc41ce130edb4e0586d97e278 (diff) | |
download | afl++-413e68ab6d588b12976c5ff34e1a27eae48c26d8.tar.gz |
Merge pull request #1499 from AFLplusplus/dev
push to stable
Diffstat (limited to 'src/afl-fuzz-queue.c')
-rw-r--r-- | src/afl-fuzz-queue.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/afl-fuzz-queue.c b/src/afl-fuzz-queue.c index 02d697ab..d8dbdfbe 100644 --- a/src/afl-fuzz-queue.c +++ b/src/afl-fuzz-queue.c @@ -795,8 +795,14 @@ void cull_queue(afl_state_t *afl) { u32 calculate_score(afl_state_t *afl, struct queue_entry *q) { - u32 avg_exec_us = afl->total_cal_us / afl->total_cal_cycles; - u32 avg_bitmap_size = afl->total_bitmap_size / afl->total_bitmap_entries; + u32 cal_cycles = afl->total_cal_cycles; + u32 bitmap_entries = afl->total_bitmap_entries; + + if (unlikely(!cal_cycles)) { cal_cycles = 1; } + if (unlikely(!bitmap_entries)) { bitmap_entries = 1; } + + u32 avg_exec_us = afl->total_cal_us / cal_cycles; + u32 avg_bitmap_size = afl->total_bitmap_size / bitmap_entries; u32 perf_score = 100; /* Adjust score based on execution speed of this path, compared to the |