| 681 | } |
| 682 | |
| 683 | static void useFunctionArgs(const Token *tok, Variables& variables) |
| 684 | { |
| 685 | // TODO: Match function args to see if they are const or not. Assume that const data is not written. |
| 686 | if (!tok) |
| 687 | return; |
| 688 | if (tok->str() == ",") { |
| 689 | useFunctionArgs(tok->astOperand1(), variables); |
| 690 | useFunctionArgs(tok->astOperand2(), variables); |
| 691 | } else if (Token::Match(tok, "[+:]") && (!tok->valueType() || tok->valueType()->pointer)) { |
| 692 | useFunctionArgs(tok->astOperand1(), variables); |
| 693 | useFunctionArgs(tok->astOperand2(), variables); |
| 694 | } else if (tok->variable() && tok->variable()->isArray()) { |
| 695 | variables.use(tok->varId(), tok); |
| 696 | } |
| 697 | } |
| 698 | |
| 699 | //--------------------------------------------------------------------------- |
| 700 | // Usage of function variables |
no test coverage detected