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

Function get_array_arg_constraint

src/program/transform.rs:1430–1455  ·  view source on GitHub ↗
(
    constraints: &APIConstraints,
    call_name: &str,
    arg_pos: &usize,
)

Source from the content-addressed store, hash-verified

1428}
1429
1430fn get_array_arg_constraint(
1431 constraints: &APIConstraints,
1432 call_name: &str,
1433 arg_pos: &usize,
1434) -> Option<Constraint> {
1435 if let Some(func_constraints) = constraints.get(call_name) {
1436 for constraint in func_constraints {
1437 if let crate::program::infer::Constraint::ArrayLen((array_pos, _)) = constraint {
1438 if array_pos == arg_pos {
1439 return Some(constraint.clone());
1440 }
1441 }
1442 if let crate::program::infer::Constraint::WeakArrayLen((array_pos, _)) = constraint {
1443 if array_pos == arg_pos {
1444 return Some(constraint.clone());
1445 }
1446 }
1447 if let crate::program::infer::Constraint::ArrayIndex((array_pos, _)) = constraint {
1448 if array_pos == arg_pos {
1449 return Some(constraint.clone());
1450 }
1451 }
1452 }
1453 }
1454 None
1455}
1456
1457// those args are constrained, we don't rand mutate those args.
1458fn filter_constrained_integer_args(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected