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

Function is_integer_literal

src/ast/visitor.rs:429–449  ·  view source on GitHub ↗
(node: &Node)

Source from the content-addressed store, hash-verified

427 }
428
429 pub fn is_integer_literal(node: &Node) -> bool {
430 let node = node.ignore_parenexpr();
431 if let Clang::IntegerLiteral(_) = &node.kind {
432 return true;
433 }
434 /* EnumConstant should not be considered as integer literal. Pass the EnumConstant with integer will cause compilation error.
435 if let Clang::EnumConstantDecl(_) = &node.kind {
436 return true;
437 }
438 */
439 if let Clang::UnaryOperator(uo) = &node.kind {
440 if !uo.is_minus() || node.inner.len() != 1 {
441 return false;
442 }
443 if let Clang::IntegerLiteral(_) = &node.inner[0].kind {
444 return true;
445 }
446 }
447
448 false
449 }
450
451 /// whether this arg is fuzzable.
452 /// 1. should not returned by call

Callers 2

is_arg_fuzzableFunction · 0.85
is_ret_by_callFunction · 0.85

Calls 2

ignore_parenexprMethod · 0.80
is_minusMethod · 0.80

Tested by

no test coverage detected