about summary refs log tree commit diff
path: root/qemu_mode/patches/afl-qemu-tcg-runtime-inl.h
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-03-18 22:56:19 +0100
committerhexcoder- <heiko@hexco.de>2020-03-18 22:56:19 +0100
commitb19039ba8b725ac240a064a144b5a6386b48a4e5 (patch)
treedf4a3baa383c45747578435b306f5dcfa9bbde79 /qemu_mode/patches/afl-qemu-tcg-runtime-inl.h
parent94a4cc8415e21416edadffed25c53bd5fe3e1d9e (diff)
parent2e4fda6d4cc9ec40f81f5a72b874281efa714188 (diff)
downloadafl++-b19039ba8b725ac240a064a144b5a6386b48a4e5.tar.gz
Merge branch 'master' of https://github.com/vanhauser-thc/AFLplusplus
Diffstat (limited to 'qemu_mode/patches/afl-qemu-tcg-runtime-inl.h')
-rw-r--r--qemu_mode/patches/afl-qemu-tcg-runtime-inl.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/qemu_mode/patches/afl-qemu-tcg-runtime-inl.h b/qemu_mode/patches/afl-qemu-tcg-runtime-inl.h
index 04fcde4e..b7cd71bb 100644
--- a/qemu_mode/patches/afl-qemu-tcg-runtime-inl.h
+++ b/qemu_mode/patches/afl-qemu-tcg-runtime-inl.h
@@ -171,7 +171,7 @@ static int area_is_mapped(void *ptr, size_t len) {
 
 }
 
-void HELPER(afl_cmplog_rtn)(CPUX86State *env) {
+void HELPER(afl_cmplog_rtn)(CPUArchState *env) {
 
 #if defined(TARGET_X86_64)
 
@@ -199,7 +199,12 @@ void HELPER(afl_cmplog_rtn)(CPUX86State *env) {
 
   if (!area_is_mapped(ptr1, 32) || !area_is_mapped(ptr2, 32)) return;
 
+#if defined(TARGET_X86_64) || defined(TARGET_I386)
   uintptr_t k = (uintptr_t)env->eip;
+#else
+  uintptr_t k = 0;
+#endif
+
   k = (k >> 4) ^ (k << 8);
   k &= CMP_MAP_W - 1;