diff options
author | van Hauser <vh@thc.org> | 2020-04-08 23:15:42 +0200 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-04-09 10:23:37 +0200 |
commit | c8ca944faccc968b0fe54649cecc95e288911bc6 (patch) | |
tree | 1ceeaa70a14d6f25776c141f317eebcaade4e520 | |
parent | b5e4d1a49106fa51995f220a5fa45455c06a8f25 (diff) | |
download | afl++-c8ca944faccc968b0fe54649cecc95e288911bc6.tar.gz |
fix review comments by Heiko
-rw-r--r-- | llvm_mode/README.snapshot.md | 4 | ||||
-rw-r--r-- | llvm_mode/afl-clang-fast.c | 27 |
2 files changed, 17 insertions, 14 deletions
diff --git a/llvm_mode/README.snapshot.md b/llvm_mode/README.snapshot.md index 6bf76b3d..cae86a4a 100644 --- a/llvm_mode/README.snapshot.md +++ b/llvm_mode/README.snapshot.md @@ -1,7 +1,7 @@ # AFL++ snapshot feature -Snapshot is a mechanic that makes a snapshot from a process and then restores -it's state, which is faster then forking it again. +Snapshotting is a feature that makes a snapshot from a process and then +restores it's state, which is faster then forking it again. All targets compiled with llvm_mode are automatically enabled for the snapshot feature. diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c index 657d1a84..e2b44def 100644 --- a/llvm_mode/afl-clang-fast.c +++ b/llvm_mode/afl-clang-fast.c @@ -294,22 +294,25 @@ static void edit_params(u32 argc, char **argv, char **envp) { cc_params[cc_par_cnt++] = lto_flag; - } else + } else { - if (instrument_mode == INSTRUMENT_PCGUARD) { + if (instrument_mode == INSTRUMENT_PCGUARD) { - cc_params[cc_par_cnt++] = - "-fsanitize-coverage=trace-pc-guard"; // edge coverage by default + cc_params[cc_par_cnt++] = + "-fsanitize-coverage=trace-pc-guard"; // edge coverage by default - } else { + } else { - cc_params[cc_par_cnt++] = "-Xclang"; - cc_params[cc_par_cnt++] = "-load"; - cc_params[cc_par_cnt++] = "-Xclang"; - if (instrument_mode == INSTRUMENT_CFG) - cc_params[cc_par_cnt++] = alloc_printf("%s/libLLVMInsTrim.so", obj_path); - else - cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-pass.so", obj_path); + cc_params[cc_par_cnt++] = "-Xclang"; + cc_params[cc_par_cnt++] = "-load"; + cc_params[cc_par_cnt++] = "-Xclang"; + if (instrument_mode == INSTRUMENT_CFG) + cc_params[cc_par_cnt++] = + alloc_printf("%s/libLLVMInsTrim.so", obj_path); + else + cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-pass.so", obj_path); + + } } |