about summary refs log tree commit diff
path: root/llvm_mode/afl-clang-fast.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-08-31 19:04:37 +0200
committerGitHub <noreply@github.com>2020-08-31 19:04:37 +0200
commit2dffed1cffcd78db16412d0531d2976bfd3bc0fe (patch)
treedd41be1ffcc9e471591d7c7bd899baf1987aeb97 /llvm_mode/afl-clang-fast.c
parent42ef1968a530d5fe598d53e93431dfcff3727b4b (diff)
parente93f78eca53e3b1542d109fd9b4c634831e9fd63 (diff)
downloadafl++-2dffed1cffcd78db16412d0531d2976bfd3bc0fe.tar.gz
Merge pull request #534 from AFLplusplus/dev
push to stable for GSOC
Diffstat (limited to 'llvm_mode/afl-clang-fast.c')
-rw-r--r--llvm_mode/afl-clang-fast.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c
index d1fa548c..ccdbca9d 100644
--- a/llvm_mode/afl-clang-fast.c
+++ b/llvm_mode/afl-clang-fast.c
@@ -670,9 +670,11 @@ static void edit_params(u32 argc, char **argv, char **envp) {
 
   }
 
+  #ifndef __APPLE__
   if (!shared_linking)
     cc_params[cc_par_cnt++] =
         alloc_printf("-Wl,--dynamic-list=%s/dynamic_list.txt", obj_path);
+  #endif
 
 #endif
 
@@ -811,13 +813,25 @@ int main(int argc, char **argv, char **envp) {
       if (strncasecmp(ptr, "ngram", strlen("ngram")) == 0) {
 
         ptr += strlen("ngram");
-        while (*ptr && (*ptr < '0' || *ptr > '9'))
+        while (*ptr && (*ptr < '0' || *ptr > '9')) {
+
           ptr++;
-        if (!*ptr)
-          if ((ptr = getenv("AFL_LLVM_NGRAM_SIZE")) != NULL)
+
+        }
+
+        if (!*ptr) {
+
+          ptr = getenv("AFL_LLVM_NGRAM_SIZE");
+          if (!ptr || !*ptr) {
+
             FATAL(
                 "you must set the NGRAM size with (e.g. for value 2) "
                 "AFL_LLVM_INSTRUMENT=ngram-2");
+
+          }
+
+        }
+
         ngram_size = atoi(ptr);
         if (ngram_size < 2 || ngram_size > NGRAM_SIZE_MAX)
           FATAL(