aboutsummaryrefslogtreecommitdiff
path: root/include/types.h
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2019-10-25 14:25:37 +0100
committerDavid Carlier <devnexen@gmail.com>2019-10-25 14:40:04 +0100
commit15c920a6126e3a0b5ac5a7293188c3d7a523bbde (patch)
tree7072c2bc127d41fd50ea8a07080733ea8f02b928 /include/types.h
parente7871b2c7675e0f6df4fbe1a8f53a23ed5d2024f (diff)
downloadAFLplusplus-15c920a6126e3a0b5ac5a7293188c3d7a523bbde.tar.gz
Little compiler plugins rework regarding block location picked up.
Diffstat (limited to 'include/types.h')
-rw-r--r--include/types.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/types.h b/include/types.h
index c34bf522..3f34db66 100644
--- a/include/types.h
+++ b/include/types.h
@@ -79,9 +79,21 @@ typedef int64_t s64;
})
#ifdef AFL_LLVM_PASS
+#if defined(__linux__)
+#define AFL_SR(s) (srandom(s))
#define AFL_R(x) (random() % (x))
#else
+#define AFL_SR(s)
+#define AFL_R(x) (arc4random_uniform(x))
+#endif
+#else
+#if defined(__linux__)
+#define SR(s) (srandom(s))
#define R(x) (random() % (x))
+#else
+#define SR(s)
+#define R(x) (arc4random_uniform(x))
+#endif
#endif /* ^AFL_LLVM_PASS */
#define STRINGIFY_INTERNAL(x) #x