diff options
author | vanhauser-thc <vh@thc.org> | 2022-01-19 22:17:36 +0100 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2022-01-19 22:17:36 +0100 |
commit | 4bcb177f62695da4f76f3e74393c8018d52f8a7c (patch) | |
tree | e8bbc172527de4958f4ec5bb483e55af3f04b7cd /include/coverage-32.h | |
parent | 409a6517c1e60e91b6d6154496b5f77fdce2186a (diff) | |
download | afl++-4bcb177f62695da4f76f3e74393c8018d52f8a7c.tar.gz |
Revert "fix classify counts"
This reverts commit 4217a6606c92f6a88ab577ae8f91823dd731562d.
Diffstat (limited to 'include/coverage-32.h')
-rw-r--r-- | include/coverage-32.h | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/include/coverage-32.h b/include/coverage-32.h index d213db12..ca36c29f 100644 --- a/include/coverage-32.h +++ b/include/coverage-32.h @@ -62,23 +62,6 @@ inline void classify_counts(afl_forkserver_t *fsrv) { } -inline void classify_counts_off(afl_forkserver_t *fsrv, u32 off) { - - u32 *mem = (u32 *)(fsrv->trace_bits + off); - u32 i = ((fsrv->map_size - off) >> 2); - - while (i--) { - - /* Optimize for sparse bitmaps. */ - - if (unlikely(*mem)) { *mem = classify_word(*mem); } - - mem++; - - } - -} - /* Updates the virgin bits, then reflects whether a new count or a new tuple is * seen in ret. */ inline void discover_word(u8 *ret, u32 *current, u32 *virgin) { @@ -87,7 +70,7 @@ inline void discover_word(u8 *ret, u32 *current, u32 *virgin) { that have not been already cleared from the virgin map - since this will almost always be the case. */ - if (unlikely(*current & *virgin)) { + if (*current & *virgin) { if (likely(*ret < 2)) { @@ -97,8 +80,8 @@ inline void discover_word(u8 *ret, u32 *current, u32 *virgin) { /* Looks like we have not found any new bytes yet; see if any non-zero bytes in current[] are pristine in virgin[]. */ - if (unlikely((cur[0] && vir[0] == 0xff) || (cur[1] && vir[1] == 0xff) || - (cur[2] && vir[2] == 0xff) || (cur[3] && vir[3] == 0xff))) + if ((cur[0] && vir[0] == 0xff) || (cur[1] && vir[1] == 0xff) || + (cur[2] && vir[2] == 0xff) || (cur[3] && vir[3] == 0xff)) *ret = 2; else *ret = 1; @@ -114,14 +97,12 @@ inline void discover_word(u8 *ret, u32 *current, u32 *virgin) { #define PACK_SIZE 16 inline u32 skim(const u32 *virgin, const u32 *current, const u32 *current_end) { - u32 *save = (u32*) current; - for (; current < current_end; virgin += 4, current += 4) { - if (unlikely(current[0] && classify_word(current[0]) & virgin[0])) return (u32)(¤t[1] - save); - if (unlikely(current[1] && classify_word(current[1]) & virgin[1])) return (u32)(¤t[2] - save); - if (unlikely(current[2] && classify_word(current[2]) & virgin[2])) return (u32)(¤t[3] - save); - if (unlikely(current[3] && classify_word(current[3]) & virgin[3])) return (u32)(¤t[4] - save); + if (current[0] && classify_word(current[0]) & virgin[0]) return 1; + if (current[1] && classify_word(current[1]) & virgin[1]) return 1; + if (current[2] && classify_word(current[2]) & virgin[2]) return 1; + if (current[3] && classify_word(current[3]) & virgin[3]) return 1; } |