aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-08-15 22:10:28 +0200
committervan Hauser <vh@thc.org>2020-08-15 22:10:28 +0200
commit43214d6b46643f70fc7979dd37a23bda76ed3171 (patch)
tree94525f0ae14076023a1df84115b5960f93c450d3
parent2f28ecd3a522faff6bcdf42b8cb0fd8cd3dc28ce (diff)
downloadafl++-43214d6b46643f70fc7979dd37a23bda76ed3171.tar.gz
more likely
-rw-r--r--src/afl-fuzz-one.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/afl-fuzz-one.c b/src/afl-fuzz-one.c
index 5a4ac8ef..0a4be320 100644
--- a/src/afl-fuzz-one.c
+++ b/src/afl-fuzz-one.c
@@ -95,7 +95,7 @@ static u32 choose_block_len(afl_state_t *afl, u32 limit) {
default:
- if (rand_below(afl, 10)) {
+ if (likely(rand_below(afl, 10))) {
min_value = HAVOC_BLK_MEDIUM;
max_value = HAVOC_BLK_LARGE;
@@ -421,7 +421,7 @@ u8 fuzz_one_original(afl_state_t *afl) {
if (((afl->queue_cur->was_fuzzed > 0 || afl->queue_cur->fuzz_level > 0) ||
!afl->queue_cur->favored) &&
- rand_below(afl, 100) < SKIP_TO_NEW_PROB) {
+ likely(rand_below(afl, 100) < SKIP_TO_NEW_PROB)) {
return 1;
@@ -438,11 +438,11 @@ u8 fuzz_one_original(afl_state_t *afl) {
if (afl->queue_cycle > 1 &&
(afl->queue_cur->fuzz_level == 0 || afl->queue_cur->was_fuzzed)) {
- if (rand_below(afl, 100) < SKIP_NFAV_NEW_PROB) { return 1; }
+ if (likely(rand_below(afl, 100) < SKIP_NFAV_NEW_PROB)) { return 1; }
} else {
- if (rand_below(afl, 100) < SKIP_NFAV_OLD_PROB) { return 1; }
+ if (likely(rand_below(afl, 100) < SKIP_NFAV_OLD_PROB)) { return 1; }
}
@@ -2132,7 +2132,7 @@ havoc_stage:
u32 clone_from, clone_to, clone_len;
u8 *new_buf;
- if (actually_clone) {
+ if (likely(actually_clone)) {
clone_len = choose_block_len(afl, temp_len);
clone_from = rand_below(afl, temp_len - clone_len + 1);
@@ -2155,7 +2155,7 @@ havoc_stage:
/* Inserted part */
- if (actually_clone) {
+ if (likely(actually_clone)) {
memcpy(new_buf + clone_to, out_buf + clone_from, clone_len);
@@ -2195,7 +2195,7 @@ havoc_stage:
copy_from = rand_below(afl, temp_len - copy_len + 1);
copy_to = rand_below(afl, temp_len - copy_len + 1);
- if (rand_below(afl, 4)) {
+ if (likely(rand_below(afl, 4))) {
if (copy_from != copy_to) {