about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2020-07-27 10:07:12 +0200
committerGitHub <noreply@github.com>2020-07-27 10:07:12 +0200
commitfb9888a068f532db789c84113587596cd7ca6ebe (patch)
tree93c229dbf15a1c80e92dceca336817bf04f97a7d
parent11f25747a97156dd230a20ecda6a7bba672238bb (diff)
parent89557d16077652c52df4244809a0e9c733a788cc (diff)
downloadafl++-fb9888a068f532db789c84113587596cd7ca6ebe.tar.gz
Merge pull request #468 from Kirin-say/fix_qemu_mode
Fix bug in qemu mode
-rw-r--r--qemu_mode/patches/afl-qemu-cpu-inl.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/qemu_mode/patches/afl-qemu-cpu-inl.h b/qemu_mode/patches/afl-qemu-cpu-inl.h
index 5f579687..07da9324 100644
--- a/qemu_mode/patches/afl-qemu-cpu-inl.h
+++ b/qemu_mode/patches/afl-qemu-cpu-inl.h
@@ -620,7 +620,8 @@ static void afl_wait_tsl(CPUState *cpu, int fd) {
 
         last_tb = tb_htable_lookup(cpu, c.last_tb.pc, c.last_tb.cs_base,
                                    c.last_tb.flags, c.cf_mask);
-        if (last_tb) { tb_add_jump(last_tb, c.tb_exit, tb); }
+#define TB_JMP_RESET_OFFSET_INVALID 0xffff
+        if (last_tb && (last_tb->jmp_reset_offset[c.tb_exit] != TB_JMP_RESET_OFFSET_INVALID)) { tb_add_jump(last_tb, c.tb_exit, tb); }
 
       }