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

Method transform_check

src/program/infer/dynamic_infer.rs:62–96  ·  view source on GitHub ↗
(
        &mut self,
        driver: &Path,
        corpora: &Path,
    )

Source from the content-addressed store, hash-verified

60
61impl Executor {
62 pub fn transform_check(
63 &mut self,
64 driver: &Path,
65 corpora: &Path,
66 ) -> Result<Option<ProgramError>> {
67 self.deopt
68 .prepare_transform_path_for_driver(driver, corpora)?;
69
70 let check_dir = get_file_dirname(driver);
71 let fuzz_binary: PathBuf = [check_dir.clone(), "fuzzer".into()].iter().collect();
72 self.compile(
73 vec![driver],
74 &fuzz_binary,
75 crate::execution::Compile::FUZZER,
76 )?;
77
78 let corpus: PathBuf = [check_dir, "corpus".into()].iter().collect();
79 let max_total_time = "-max_total_time=60".to_string();
80 let mut extra_args = vec![
81 corpus.as_os_str().to_os_string(),
82 OsString::from(max_total_time),
83 ];
84 let dict = self.deopt.get_library_build_dict_path().unwrap();
85 if dict.exists() {
86 let dict_arg = format!("-dict={}", dict.to_string_lossy());
87 extra_args.push(OsString::from(dict_arg));
88 }
89 let has_err = self.execute(&fuzz_binary, extra_args, vec![], None, None, false)?;
90 if let Some(ProgramError::Hang(err_msg)) = &has_err {
91 if err_msg.starts_with("Execute hang!") {
92 return Ok(None);
93 }
94 }
95 Ok(has_err)
96 }
97}
98
99pub fn infer(static_constraint: &mut APIConstraints, deopt: &Deopt) -> Result<()> {

Callers 1

Calls 6

get_file_dirnameFunction · 0.85
compileMethod · 0.45
pushMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected