| 242 | } |
| 243 | |
| 244 | virtual Action isAliasModified(const Token* tok, int indirect = -1) const { |
| 245 | // Lambda function call |
| 246 | if (Token::Match(tok, "%var% (")) |
| 247 | // TODO: Check if modified in the lambda function |
| 248 | return Action::Invalid; |
| 249 | if (indirect == -1) { |
| 250 | indirect = 0; |
| 251 | if (const ValueType* vt = tok->valueType()) { |
| 252 | indirect = vt->pointer; |
| 253 | if (vt->type == ValueType::ITERATOR) |
| 254 | ++indirect; |
| 255 | const Token* tok2 = tok; |
| 256 | while (Token::simpleMatch(tok2->astParent(), "[")) { |
| 257 | tok2 = tok2->astParent(); |
| 258 | --indirect; |
| 259 | } |
| 260 | indirect = std::max(indirect, 0); |
| 261 | } |
| 262 | } |
| 263 | for (int i = 0; i <= indirect; ++i) |
| 264 | if (isVariableChanged(tok, i, getSettings())) |
| 265 | return Action::Invalid; |
| 266 | return Action::None; |
| 267 | } |
| 268 | |
| 269 | virtual Action isThisModified(const Token* tok) const { |
| 270 | if (isThisChanged(tok, 0, getSettings())) |
no test coverage detected