aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2023-04-28 11:42:21 +0200
committervanhauser-thc <vh@thc.org>2023-04-28 11:42:21 +0200
commit5813a4319c88848b2a1c47c12fe27f5e14dcad44 (patch)
tree0b383557568b043a42e7eaa15a1d91c38a60cb56 /src
parente956f23a77b776a5c11344889503c833adbf1052 (diff)
downloadafl++-5813a4319c88848b2a1c47c12fe27f5e14dcad44.tar.gz
doc, code format
Diffstat (limited to 'src')
-rw-r--r--src/afl-cc.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/afl-cc.c b/src/afl-cc.c
index b11a041d..19314555 100644
--- a/src/afl-cc.c
+++ b/src/afl-cc.c
@@ -752,15 +752,21 @@ static void edit_params(u32 argc, char **argv, char **envp) {
} else if (instrument_mode == INSTRUMENT_LLVMNATIVE) {
#if LLVM_MAJOR >= 4
- if (instrument_opt_mode & INSTRUMENT_OPT_CODECOV) {
+ if (instrument_opt_mode & INSTRUMENT_OPT_CODECOV) {
+
#if LLVM_MAJOR >= 6
- cc_params[cc_par_cnt++] = "-fsanitize-coverage=trace-pc-guard,bb,no-prune,pc-table";
+ cc_params[cc_par_cnt++] =
+ "-fsanitize-coverage=trace-pc-guard,bb,no-prune,pc-table";
#else
FATAL("pcguard instrumentation with pc-table requires llvm 6.0.1+");
#endif
- } else {
+
+ } else {
+
cc_params[cc_par_cnt++] = "-fsanitize-coverage=trace-pc-guard";
- }
+
+ }
+
#else
FATAL("pcguard instrumentation requires llvm 4.0.1+");
#endif
@@ -1660,13 +1666,17 @@ int main(int argc, char **argv, char **envp) {
instrument_mode = INSTRUMENT_CLASSIC;
lto_mode = 1;
- } else if (!instrument_mode || instrument_mode == INSTRUMENT_AFL)
+ } else if (!instrument_mode || instrument_mode == INSTRUMENT_AFL) {
instrument_mode = INSTRUMENT_AFL;
- else
+
+ } else {
+
FATAL("main instrumentation mode already set with %s",
instrument_mode_string[instrument_mode]);
+ }
+
}
if (strncasecmp(ptr2, "pc-guard", strlen("pc-guard")) == 0 ||
@@ -1695,12 +1705,17 @@ int main(int argc, char **argv, char **envp) {
strncasecmp(ptr2, "llvm-codecov", strlen("llvm-codecov")) == 0) {
if (!instrument_mode || instrument_mode == INSTRUMENT_LLVMNATIVE) {
+
instrument_mode = INSTRUMENT_LLVMNATIVE;
- instrument_opt_mode |= INSTRUMENT_OPT_CODECOV;
- } else
+ instrument_opt_mode |= INSTRUMENT_OPT_CODECOV;
+
+ } else {
+
FATAL("main instrumentation mode already set with %s",
instrument_mode_string[instrument_mode]);
+ }
+
}
if (strncasecmp(ptr2, "cfg", strlen("cfg")) == 0 ||