From a99d0b29674f8a6f7a0c9af30e371ab3ebbcb14e Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Tue, 12 Apr 2022 20:34:38 +0200 Subject: [PATCH] Fix clang linking without --libafl arg (#608) * Fix clang linking without --libafl arg * clippy --- libafl/src/stages/sync.rs | 2 +- libafl_cc/src/clang.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libafl/src/stages/sync.rs b/libafl/src/stages/sync.rs index 8da43f4fda..5484403216 100644 --- a/libafl/src/stages/sync.rs +++ b/libafl/src/stages/sync.rs @@ -140,7 +140,7 @@ where } max_time = Some(max_time.map_or(time, |t: SystemTime| t.max(time))); let input = (self.load_callback)(fuzzer, state, &path)?; - drop(fuzzer.evaluate_input(state, executor, manager, input)?); + fuzzer.evaluate_input(state, executor, manager, input)?; } } else if attr.is_dir() { let dir_max_time = diff --git a/libafl_cc/src/clang.rs b/libafl_cc/src/clang.rs index 2d703a0645..d116ff6f33 100644 --- a/libafl_cc/src/clang.rs +++ b/libafl_cc/src/clang.rs @@ -174,7 +174,10 @@ impl CompilerWrapper for ClangWrapper { new_args.push(args[i].as_ref().to_string()); i += 1; } - if linking && suppress_linking >= 0 && suppress_linking < 1337 { + if linking + && (suppress_linking > 0 || (self.has_libafl_arg && suppress_linking == 0)) + && suppress_linking < 1337 + { linking = false; new_args.push( PathBuf::from(env!("OUT_DIR"))