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

Function get_fuzzable_funcs

src/program/gadget.rs:1014–1025  ·  view source on GitHub ↗

Get the functions with their fuzzable parameters. Returned with the map of Function names and vectors of fuzzable parameters' positions.

()

Source from the content-addressed store, hash-verified

1012/// Get the functions with their fuzzable parameters.
1013/// Returned with the map of Function names and vectors of fuzzable parameters' positions.
1014pub fn get_fuzzable_funcs() -> &'static HashMap<String, Vec<usize>> {
1015 static FUNCS: OnceCell<HashMap<String, Vec<usize>>> = OnceCell::new();
1016 FUNCS.get_or_init(|| {
1017 let mut funcs: HashMap<String, Vec<usize>> = HashMap::new();
1018 for gadget in get_func_gadgets() {
1019 let name = gadget.name.clone();
1020 let param_pos = gadget.get_fuzzable_params();
1021 funcs.insert(name, param_pos);
1022 }
1023 funcs
1024 })
1025}
1026
1027#[cfg(test)]
1028mod tests {

Callers 2

test_fuzzable_funcsFunction · 0.85

Calls 2

get_func_gadgetsFunction · 0.85
get_fuzzable_paramsMethod · 0.80

Tested by 1

test_fuzzable_funcsFunction · 0.68