about summary refs log tree commit diff
path: root/qemu_mode/patches/afl-qemu-cpu-translate-inl.h
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2019-08-21 00:40:12 -0700
committerGitHub <noreply@github.com>2019-08-21 00:40:12 -0700
commitfcc349467f41b2e7414f925d3ef3bbbdc61bac8a (patch)
tree161c52778d5e4943f2e106a2acf6667ceab3ba2e /qemu_mode/patches/afl-qemu-cpu-translate-inl.h
parentcc55e5c6d8ead610606649fa5aad39671f55bece (diff)
parentd6beac5235118b251deb18a6579aab85271eaa7b (diff)
downloadafl++-fcc349467f41b2e7414f925d3ef3bbbdc61bac8a.tar.gz
Merge pull request #47 from vanhauser-thc/immediates-compcov
compcov levels to enable the instrumentation of only comparisons with immediates
Diffstat (limited to 'qemu_mode/patches/afl-qemu-cpu-translate-inl.h')
-rw-r--r--qemu_mode/patches/afl-qemu-cpu-translate-inl.h9
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) {