| 548 | } |
| 549 | |
| 550 | void ProgramMemoryState::assume(const Token* tok, bool b, bool isEmpty) |
| 551 | { |
| 552 | ProgramMemory pm = state; |
| 553 | if (isEmpty) |
| 554 | pm.setContainerSizeValue(tok, 0, b); |
| 555 | else |
| 556 | programMemoryParseCondition(pm, tok, nullptr, settings, b); |
| 557 | const Token* origin = tok; |
| 558 | const Token* top = tok->astTop(); |
| 559 | if (Token::Match(top->previous(), "for|while|if (") && !Token::simpleMatch(tok->astParent(), "?")) { |
| 560 | origin = top->link()->next(); |
| 561 | if (!b && origin->link()) { |
| 562 | origin = origin->link(); |
| 563 | } |
| 564 | } |
| 565 | replace(std::move(pm), origin); |
| 566 | } |
| 567 | |
| 568 | void ProgramMemoryState::removeModifiedVars(const Token* tok) |
| 569 | { |
no test coverage detected