diff options
author | hexcoder- <heiko@hexco.de> | 2019-10-23 11:33:20 +0200 |
---|---|---|
committer | hexcoder- <heiko@hexco.de> | 2019-10-23 11:33:20 +0200 |
commit | 7d9eed0ed5a57f16b15fe2576da4aec79e0909c9 (patch) | |
tree | 1adb6b21b31167d27d080d082e972d41fe061179 /gcc_plugin/afl-gcc-rt.o.c | |
parent | 1398d8d5a64b11a62e8ed25732e2114a5dc47564 (diff) | |
download | afl++-7d9eed0ed5a57f16b15fe2576da4aec79e0909c9.tar.gz |
no functional change, avoid conditional jump
Diffstat (limited to 'gcc_plugin/afl-gcc-rt.o.c')
-rw-r--r-- | gcc_plugin/afl-gcc-rt.o.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc_plugin/afl-gcc-rt.o.c b/gcc_plugin/afl-gcc-rt.o.c index 47049167..5b70a247 100644 --- a/gcc_plugin/afl-gcc-rt.o.c +++ b/gcc_plugin/afl-gcc-rt.o.c @@ -58,11 +58,14 @@ __thread u32 __afl_prev_loc; void __afl_trace(u32 x) { u32 l = __afl_prev_loc; - __afl_area_ptr[l ^ x]++; - /* // neverZero is disable as gcc creates non-performant code. shame on you gcc - if (__afl_area_ptr[l ^ x] == 0) - __afl_area_ptr[l ^ x]++; - */ + +#if 0 /* enable for neverZero feature. By default disabled since too inefficient :-( */ + /* @Marc: avoid conditional jumps here */ + __afl_area_ptr[l ^ x] += 1 + (__afl_area_ptr[l ^ x] == (u8)~0); +#else + ++__afl_area_ptr[l ^ x]; +#endif + __afl_prev_loc = (x >> 1); return; |