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

Method synthesis

src/program/libfuzzer.rs:196–224  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

194 }
195
196 pub fn synthesis(&mut self) -> Result<()> {
197 log::info!("synthesis huge fuzzers!");
198 let driver_dir = self.deopt.get_library_driver_dir()?;
199 let drivers: Vec<PathBuf> = deopt::utils::read_sort_dir(&driver_dir)?
200 .iter()
201 .filter(|x| x.extension().is_some() && x.extension().unwrap().to_string_lossy() == "cc")
202 .cloned()
203 .collect();
204
205 let mut batch = Vec::new();
206 let mut batch_id = Vec::new();
207 let mut fuzzer_id = 0;
208
209 for (i, driver) in drivers.iter().enumerate() {
210 if !self.use_constraint || self.is_valid_driver(driver) {
211 batch.push(driver.clone());
212 batch_id.push(i);
213 }
214 if batch.len() == self.batch || i == drivers.len() - 1 {
215 let fuzzer_content = self.synthesis_batch(&batch_id)?;
216 self.fuse_fuzzer(fuzzer_content, fuzzer_id, &batch, &batch_id)?;
217 self.fuse_corpus(fuzzer_id, &batch)?;
218 batch.clear();
219 batch_id.clear();
220 fuzzer_id += 1;
221 }
222 }
223 Ok(())
224 }
225
226 fn fuse_fuzzer(
227 &self,

Callers 3

fuse_fuzzerFunction · 0.80

Calls 8

read_sort_dirFunction · 0.85
is_valid_driverMethod · 0.80
synthesis_batchMethod · 0.80
fuse_fuzzerMethod · 0.80
fuse_corpusMethod · 0.80
pushMethod · 0.45
clearMethod · 0.45

Tested by 1