linked with AddressSanitizer, execute it to check whether code is correct.
(&self, program_path: &Path)
| 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>> { |
| 59 | let time_logger = TimeUsage::new(get_file_dirname(program_path)); |
| 60 | let mut transformer = Transformer::new(program_path, &self.deopt)?; |
| 61 | transformer.add_fd_sanitizer()?; |
| 62 | transformer.preprocess()?; |
| 63 | |
| 64 | let mut binary_out = PathBuf::from(program_path); |
| 65 | binary_out.set_extension("out"); |
| 66 | |
| 67 | self.deopt |
| 68 | .copy_library_init_file(&get_file_dirname(program_path))?; |
| 69 | |
| 70 | self.compile(vec![program_path], &binary_out, super::Compile::FUZZER)?; |
| 71 | |
| 72 | // Execute the program on each corpus file and check error. |
| 73 | let corpus = self.deopt.get_library_shared_corpus_dir()?; |
| 74 | let has_err = self.execute_pool(&binary_out, &corpus); |
| 75 | time_logger.log("execute")?; |
| 76 | Ok(has_err) |
| 77 | } |
| 78 | |
| 79 | /// linked with LibFuzzer and AddressSanitizer, to check whether code is correct. |
| 80 | pub fn is_program_fuzz_correct(&self, program_path: &Path) -> Result<Option<ProgramError>> { |
no test coverage detected