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

Method is_program_link_correct

src/execution/sanitize.rs:41–55  ·  view source on GitHub ↗

check whether the program is correct in compilation and linkage.

(&self, program_path: &Path)

Source from the content-addressed store, hash-verified

39
40 /// check whether the program is correct in compilation and linkage.
41 fn is_program_link_correct(&self, program_path: &Path) -> Result<Option<ProgramError>> {
42 let time_logger = TimeUsage::new(get_file_dirname(program_path));
43 remove_duplicate_definition(program_path)?;
44 let mut binary_out = PathBuf::from(program_path);
45 binary_out.set_extension("out");
46
47 let res = self.compile(vec![program_path], &binary_out, super::Compile::FUZZER);
48 time_logger.log("link")?;
49
50 if let Err(err) = res {
51 let err_msg = err.to_string();
52 return Ok(Some(ProgramError::Link(err_msg)));
53 }
54 Ok(None)
55 }
56
57 /// linked with AddressSanitizer, execute it to check whether code is correct.
58 fn is_program_execute_correct(&self, program_path: &Path) -> Result<Option<ProgramError>> {

Callers 1

Calls 4

get_file_dirnameFunction · 0.85
logMethod · 0.80
compileMethod · 0.45

Tested by

no test coverage detected