(node: &Node)
| 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 |
no test coverage detected