| 674 | |
| 675 | template<class F> |
| 676 | std::vector<MathLib::bigint> evaluateInt(const Token* tok, F getProgramMemoryFunc) const |
| 677 | { |
| 678 | if (const ValueFlow::Value* v = tok->getKnownValue(ValueFlow::Value::ValueType::INT)) |
| 679 | return {v->intvalue}; |
| 680 | std::vector<MathLib::bigint> result; |
| 681 | ProgramMemory pm = getProgramMemoryFunc(); |
| 682 | if (Token::Match(tok, "&&|%oror%")) { |
| 683 | if (conditionIsTrue(tok, pm, getSettings())) |
| 684 | result.push_back(1); |
| 685 | if (conditionIsFalse(tok, std::move(pm), getSettings())) |
| 686 | result.push_back(0); |
| 687 | } else { |
| 688 | MathLib::bigint out = 0; |
| 689 | bool error = false; |
| 690 | execute(tok, pm, &out, &error, getSettings()); |
| 691 | if (!error) |
| 692 | result.push_back(out); |
| 693 | } |
| 694 | return result; |
| 695 | } |
| 696 | |
| 697 | std::vector<MathLib::bigint> evaluateInt(const Token* tok) const |
| 698 | { |
no test coverage detected