From 7f017aa724a9324492f1b19937c6097c8aed555a Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Tue, 12 Nov 2019 23:12:14 +0100 Subject: enabled neverZero feature again --- gcc_plugin/afl-gcc-rt.o.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'gcc_plugin') diff --git a/gcc_plugin/afl-gcc-rt.o.c b/gcc_plugin/afl-gcc-rt.o.c index 5b70a247..1fb9e099 100644 --- a/gcc_plugin/afl-gcc-rt.o.c +++ b/gcc_plugin/afl-gcc-rt.o.c @@ -9,8 +9,6 @@ GCC integration design is based on the LLVM design, which comes from Laszlo Szekeres. - Copyright 2015 Google Inc. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: @@ -55,15 +53,13 @@ __thread u32 __afl_prev_loc; #endif /* Trace a basic block with some ID */ -void __afl_trace(u32 x) { - - u32 l = __afl_prev_loc; +void __afl_trace(const u32 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); +#if 1 /* enable for neverZero feature. */ + __afl_area_ptr[__afl_prev_loc ^ x] += 1 + + ((u8)(1 + __afl_area_ptr[__afl_prev_loc ^ x]) == 0); #else - ++__afl_area_ptr[l ^ x]; + ++__afl_area_ptr[__afl_prev_loc ^ x]; #endif __afl_prev_loc = (x >> 1); -- cgit 1.4.1