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

Function is_arg_fuzzable

src/ast/visitor.rs:454–470  ·  view source on GitHub ↗

whether this arg is fuzzable. 1. should not returned by call 2. contains code literals

(arg: &Node, visitor: &Visitor)

Source from the content-addressed store, hash-verified

452 /// 1. should not returned by call
453 /// 2. contains code literals
454 pub fn is_arg_fuzzable(arg: &Node, visitor: &Visitor) -> bool {
455 let arg = arg.ignore_parent().ignore_cast().ignore_prefix();
456 if is_integer_literal(arg) {
457 return true;
458 }
459 match &arg.kind {
460 Clang::StringLiteral(_) => true,
461 Clang::InitListExpr(_) => true,
462 Clang::DeclRefExpr(dre) => {
463 if let Some(init) = dre.get_var_init(visitor) {
464 return is_arg_fuzzable(init, visitor);
465 }
466 false
467 }
468 _ => false,
469 }
470 }
471
472 fn is_pointer_ty(ty: &str) -> bool {
473 ty.find('*').is_some() || ty.find('[').is_some()

Callers 2

Calls 5

is_integer_literalFunction · 0.85
ignore_prefixMethod · 0.80
ignore_castMethod · 0.80
ignore_parentMethod · 0.80
get_var_initMethod · 0.80

Tested by

no test coverage detected