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

Function is_var_fuzzable

src/ast/visitor.rs:411–427  ·  view source on GitHub ↗

Whether this variable is a fuzzable variable: 1. has init 2. is pointer ty 3. ty is `const` 4. inited with String or List.

(vd: &VarDecl, node: &Node)

Source from the content-addressed store, hash-verified

409 /// 3. ty is `const`
410 /// 4. inited with String or List.
411 pub fn is_var_fuzzable(vd: &VarDecl, node: &Node) -> bool {
412 if !vd.has_init(node) {
413 return false;
414 }
415 let ty = vd.get_type().get_type_name();
416
417 if !is_pointer_ty(&ty) {
418 return false;
419 }
420
421 if !ty.starts_with("const") {
422 return false;
423 }
424
425 let init = vd.get_init(node).ignore_cast().ignore_parent();
426 matches!(&init.kind, Clang::StringLiteral(_) | Clang::InitListExpr(_))
427 }
428
429 pub fn is_integer_literal(node: &Node) -> bool {
430 let node = node.ignore_parenexpr();

Callers

nothing calls this directly

Calls 7

is_pointer_tyFunction · 0.85
has_initMethod · 0.80
get_type_nameMethod · 0.80
get_typeMethod · 0.80
ignore_parentMethod · 0.80
ignore_castMethod · 0.80
get_initMethod · 0.80

Tested by

no test coverage detected