whether this arg is fuzzable. 1. should not returned by call 2. contains code literals
(arg: &Node, visitor: &Visitor)
| 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() |
no test coverage detected