| 589 | } |
| 590 | |
| 591 | ProgramMemory ProgramMemoryState::get(const Token* tok, const Token* ctx, const ProgramMemory::Map& vars) const |
| 592 | { |
| 593 | ProgramMemoryState local = *this; |
| 594 | if (ctx) |
| 595 | local.addState(ctx, vars); |
| 596 | const Token* start = previousBeforeAstLeftmostLeaf(tok); |
| 597 | if (!start) |
| 598 | start = tok; |
| 599 | |
| 600 | if (!ctx || precedes(start, ctx)) { |
| 601 | local.removeModifiedVars(start); |
| 602 | local.addState(start, vars); |
| 603 | } else { |
| 604 | local.removeModifiedVars(ctx); |
| 605 | } |
| 606 | return local.state; |
| 607 | } |
| 608 | |
| 609 | ProgramMemory getProgramMemory(const Token* tok, const Token* expr, const ValueFlow::Value& value, const Settings& settings) |
| 610 | { |