about summary refs log tree commit diff
path: root/src/afl-analyze.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-12-23 14:58:52 +0100
committerGitHub <noreply@github.com>2020-12-23 14:58:52 +0100
commit7dc433a0c0efb236a2ab6fa4006a91aa02e26779 (patch)
treeb0a48cd22af9aaa9695b61d08499232dbe9f0f36 /src/afl-analyze.c
parent1078409875cacc5626a3961e08cf67c68049d22a (diff)
parent8d10d12ab344bdf6dfe0478e927c92278b4aac78 (diff)
downloadafl++-7dc433a0c0efb236a2ab6fa4006a91aa02e26779.tar.gz
Merge pull request #637 from AFLplusplus/dev
minor push to stable
Diffstat (limited to 'src/afl-analyze.c')
-rw-r--r--src/afl-analyze.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/afl-analyze.c b/src/afl-analyze.c
index 2780deff..a6825ef6 100644
--- a/src/afl-analyze.c
+++ b/src/afl-analyze.c
@@ -103,19 +103,29 @@ static u32 map_size = MAP_SIZE;
 /* Classify tuple counts. This is a slow & naive version, but good enough here.
  */
 
+#define TIMES4(x) x,x,x,x
+#define TIMES8(x) TIMES4(x),TIMES4(x)
+#define TIMES16(x) TIMES8(x),TIMES8(x)
+#define TIMES32(x) TIMES16(x),TIMES16(x)
+#define TIMES64(x) TIMES32(x),TIMES32(x)
 static u8 count_class_lookup[256] = {
 
     [0] = 0,
     [1] = 1,
     [2] = 2,
     [3] = 4,
-    [4 ... 7] = 8,
-    [8 ... 15] = 16,
-    [16 ... 31] = 32,
-    [32 ... 127] = 64,
-    [128 ... 255] = 128
+    [4] = TIMES4(8),
+    [8] = TIMES8(16),
+    [16] = TIMES16(32),
+    [32] = TIMES32(64),
+    [128] = TIMES64(128)
 
 };
+#undef TIMES64
+#undef TIMES32
+#undef TIMES16
+#undef TIMES8
+#undef TIMES4
 
 static void classify_counts(u8 *mem) {