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

Method change_calls_to_fuzzer

src/program/transform.rs:497–526  ·  view source on GitHub ↗
(
        &mut self,
        constraints: &APIConstraints,
        nths: Vec<usize>,
    )

Source from the content-addressed store, hash-verified

495 }
496
497 fn change_calls_to_fuzzer(
498 &mut self,
499 constraints: &APIConstraints,
500 nths: Vec<usize>,
501 ) -> Result<()> {
502 let mut cur_nth = 0;
503
504 let visitor = self.get_new_visitor()?;
505 let fuzz_variants = visitor.collect_fuzzable_variants(&visitor, constraints);
506 for fuzz_varaint in &fuzz_variants {
507 // only transform the specificed arguments
508 if !nths.contains(&cur_nth) {
509 cur_nth += 1;
510 continue;
511 }
512 self.create_unlimit_call_fuzzer_var(fuzz_varaint, &visitor)?;
513 cur_nth += 1;
514 }
515 cur_nth = 0;
516 self.update_fuzzer_shim()?;
517 for fuzz_varaint in &fuzz_variants {
518 if !nths.contains(&cur_nth) {
519 cur_nth += 1;
520 continue;
521 }
522 self.change_call_arg_fuzzable(fuzz_varaint)?;
523 cur_nth += 1;
524 }
525 Ok(())
526 }
527
528 fn _create_unlimit_call_fuzzer_var(
529 &mut self,

Callers 1

transform_to_fuzzerMethod · 0.80

Calls 5

get_new_visitorMethod · 0.80
update_fuzzer_shimMethod · 0.80

Tested by

no test coverage detected