| 4584 | } |
| 4585 | |
| 4586 | static Token* skipNotAndCasts(Token* tok, bool* inverted = nullptr) |
| 4587 | { |
| 4588 | for (; tok->astParent(); tok = tok->astParent()) { |
| 4589 | if (Token::simpleMatch(tok->astParent(), "!")) { |
| 4590 | if (inverted) |
| 4591 | *inverted ^= true; |
| 4592 | continue; |
| 4593 | } |
| 4594 | if (Token::Match(tok->astParent(), "==|!=")) { |
| 4595 | const Token* sibling = tok->astSibling(); |
| 4596 | if (sibling->hasKnownIntValue() && (astIsBool(tok) || astIsBool(sibling))) { |
| 4597 | const bool value = !!sibling->getKnownIntValue(); |
| 4598 | if (inverted) |
| 4599 | *inverted ^= value == Token::simpleMatch(tok->astParent(), "!="); |
| 4600 | continue; |
| 4601 | } |
| 4602 | } |
| 4603 | if (tok->astParent()->isCast() && astIsBool(tok->astParent())) |
| 4604 | continue; |
| 4605 | return tok; |
| 4606 | } |
| 4607 | return tok; |
| 4608 | } |
| 4609 | |
| 4610 | static void fillFromPath(ProgramMemory& pm, const Token* top, MathLib::bigint path, const Settings& settings) |
| 4611 | { |
nothing calls this directly
no test coverage detected