diff options
author | Andrea Fioraldi <andreafioraldi@gmail.com> | 2019-07-29 16:09:28 +0200 |
---|---|---|
committer | Andrea Fioraldi <andreafioraldi@gmail.com> | 2019-07-29 16:09:28 +0200 |
commit | d6beac5235118b251deb18a6579aab85271eaa7b (patch) | |
tree | 70d3cae9c17899bfe532f437119835ddfce4a553 /qemu_mode/patches/afl-qemu-cpu-translate-inl.h | |
parent | 7ca22cd552ff21ac0ef7cc1ab5e6e71912752a58 (diff) | |
download | afl++-d6beac5235118b251deb18a6579aab85271eaa7b.tar.gz |
compcov levels to enable the instrumentation of only immediates
Diffstat (limited to 'qemu_mode/patches/afl-qemu-cpu-translate-inl.h')
-rw-r--r-- | qemu_mode/patches/afl-qemu-cpu-translate-inl.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/qemu_mode/patches/afl-qemu-cpu-translate-inl.h b/qemu_mode/patches/afl-qemu-cpu-translate-inl.h index 0ca89c98..4716c2ac 100644 --- a/qemu_mode/patches/afl-qemu-cpu-translate-inl.h +++ b/qemu_mode/patches/afl-qemu-cpu-translate-inl.h @@ -40,7 +40,7 @@ extern unsigned char *afl_area_ptr; extern unsigned int afl_inst_rms; extern abi_ulong afl_start_code, afl_end_code; -extern u8 afl_enable_compcov; +extern u8 afl_compcov_level; void tcg_gen_afl_compcov_log_call(void *func, target_ulong cur_loc, TCGv_i64 arg1, TCGv_i64 arg2); @@ -95,11 +95,14 @@ static void afl_compcov_log_64(target_ulong cur_loc, target_ulong arg1, static void afl_gen_compcov(target_ulong cur_loc, TCGv_i64 arg1, TCGv_i64 arg2, - TCGMemOp ot) { + TCGMemOp ot, int is_imm) { void *func; - if (!afl_enable_compcov || cur_loc > afl_end_code || cur_loc < afl_start_code) + if (!afl_compcov_level || cur_loc > afl_end_code || cur_loc < afl_start_code) + return; + + if (!is_imm && afl_compcov_level < 2) return; switch (ot) { |