MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / compile_fuzzer

Function compile_fuzzer

src/bin/harness.rs:207–226  ·  view source on GitHub ↗
(project: String, kind: Compile, exploit: bool)

Source from the content-addressed store, hash-verified

205}
206
207fn compile_fuzzer(project: String, kind: Compile, exploit: bool) -> Result<()> {
208 let deopt = Deopt::new(project)?;
209 let executor = Executor::new(&deopt)?;
210 for dir in std::fs::read_dir(deopt.get_library_fuzzer_dir(exploit)?)? {
211 let fuzzer_dir = dir?.path();
212 if fuzzer_dir.is_dir() {
213 log::info!("Compile to Fuzzer: {fuzzer_dir:?}");
214 let fuzzer_name = match kind {
215 Compile::SANITIZE => "fuzzer_san",
216 Compile::FUZZER => "fuzzer",
217 Compile::COVERAGE => "fuzzer_cov",
218 Compile::Minimize => "fuzzer_evo",
219 };
220 let fuzzer_binary: PathBuf = [fuzzer_dir.clone(), fuzzer_name.into()].iter().collect();
221 executor.compile_lib_fuzzers(&fuzzer_dir, &fuzzer_binary, kind.clone())?;
222 deopt.copy_library_init_file(&fuzzer_dir)?;
223 }
224 }
225 Ok(())
226}
227
228fn archive(project: String, suffix: &Option<String>) -> Result<()> {
229 let current_date = Local::now().format("%Y-%m-%d").to_string();

Callers 1

mainFunction · 0.85

Calls 3

compile_lib_fuzzersMethod · 0.80

Tested by

no test coverage detected