diff options
author | Andrea Fioraldi <andreafioraldi@gmail.com> | 2019-09-14 14:40:05 +0200 |
---|---|---|
committer | Andrea Fioraldi <andreafioraldi@gmail.com> | 2019-09-14 14:40:05 +0200 |
commit | 252742ce20a5f5a0bd0f2930b57ff1ffc466a0fd (patch) | |
tree | a471039b654825240be7fe020aac6561d5dd7076 /qemu_mode/patches/afl-qemu-cpu-translate-inl.h | |
parent | 4df1ad35b336a3e835dc01817c9cc1d32f0fc10d (diff) | |
download | afl++-252742ce20a5f5a0bd0f2930b57ff1ffc466a0fd.tar.gz |
afl-qemu-trace wit CPU_TARGET=i386 build fail fix
Diffstat (limited to 'qemu_mode/patches/afl-qemu-cpu-translate-inl.h')
-rw-r--r-- | qemu_mode/patches/afl-qemu-cpu-translate-inl.h | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/qemu_mode/patches/afl-qemu-cpu-translate-inl.h b/qemu_mode/patches/afl-qemu-cpu-translate-inl.h index faf2dd75..f11b686c 100644 --- a/qemu_mode/patches/afl-qemu-cpu-translate-inl.h +++ b/qemu_mode/patches/afl-qemu-cpu-translate-inl.h @@ -38,20 +38,24 @@ static void afl_compcov_log_16(target_ulong cur_loc, target_ulong arg1, target_ulong arg2) { - if ((arg1 & 0xff) == (arg2 & 0xff)) { INC_AFL_AREA(cur_loc); } + register uintptr_t idx = cur_loc; + + if ((arg1 & 0xff) == (arg2 & 0xff)) { INC_AFL_AREA(idx); } } static void afl_compcov_log_32(target_ulong cur_loc, target_ulong arg1, target_ulong arg2) { + register uintptr_t idx = cur_loc; + if ((arg1 & 0xff) == (arg2 & 0xff)) { - INC_AFL_AREA(cur_loc); + INC_AFL_AREA(idx); if ((arg1 & 0xffff) == (arg2 & 0xffff)) { - INC_AFL_AREA(cur_loc + 1); - if ((arg1 & 0xffffff) == (arg2 & 0xffffff)) { INC_AFL_AREA(cur_loc + 2); } + INC_AFL_AREA(idx + 1); + if ((arg1 & 0xffffff) == (arg2 & 0xffffff)) { INC_AFL_AREA(idx + 2); } } @@ -61,28 +65,30 @@ static void afl_compcov_log_32(target_ulong cur_loc, target_ulong arg1, static void afl_compcov_log_64(target_ulong cur_loc, target_ulong arg1, target_ulong arg2) { + + register uintptr_t idx = cur_loc; if ((arg1 & 0xff) == (arg2 & 0xff)) { - INC_AFL_AREA(cur_loc); + INC_AFL_AREA(idx); if ((arg1 & 0xffff) == (arg2 & 0xffff)) { - INC_AFL_AREA(cur_loc + 1); + INC_AFL_AREA(idx + 1); if ((arg1 & 0xffffff) == (arg2 & 0xffffff)) { - INC_AFL_AREA(cur_loc + 2); + INC_AFL_AREA(idx + 2); if ((arg1 & 0xffffffff) == (arg2 & 0xffffffff)) { - INC_AFL_AREA(cur_loc + 3); + INC_AFL_AREA(idx + 3); if ((arg1 & 0xffffffffff) == (arg2 & 0xffffffffff)) { - INC_AFL_AREA(cur_loc + 4); + INC_AFL_AREA(idx + 4); if ((arg1 & 0xffffffffffff) == (arg2 & 0xffffffffffff)) { - INC_AFL_AREA(cur_loc + 5); + INC_AFL_AREA(idx + 5); if ((arg1 & 0xffffffffffffff) == (arg2 & 0xffffffffffffff)) { - INC_AFL_AREA(cur_loc + 6); + INC_AFL_AREA(idx + 6); } |