| 3325 | } |
| 3326 | |
| 3327 | static ValueFlow::Value makeConditionValue(long long val, |
| 3328 | const Token* condTok, |
| 3329 | bool assume, |
| 3330 | bool impossible, |
| 3331 | const Settings& settings, |
| 3332 | SourceLocation loc = SourceLocation::current()) |
| 3333 | { |
| 3334 | ValueFlow::Value v(val); |
| 3335 | v.setKnown(); |
| 3336 | if (impossible) { |
| 3337 | v.intvalue = !v.intvalue; |
| 3338 | v.setImpossible(); |
| 3339 | } |
| 3340 | v.condition = condTok; |
| 3341 | if (assume) |
| 3342 | v.errorPath.emplace_back(condTok, "Assuming condition '" + condTok->expressionString() + "' is true"); |
| 3343 | else |
| 3344 | v.errorPath.emplace_back(condTok, "Assuming condition '" + condTok->expressionString() + "' is false"); |
| 3345 | if (settings.debugnormal) |
| 3346 | setSourceLocation(v, loc, condTok); |
| 3347 | return v; |
| 3348 | } |
| 3349 | |
| 3350 | static std::vector<const Token*> getConditions(const Token* tok, const char* op) |
| 3351 | { |
no test coverage detected