| 3876 | } |
| 3877 | |
| 3878 | static ValueFlow::Value::Bound findVarBound(const Variable* var, |
| 3879 | const Token* start, |
| 3880 | const Token* end, |
| 3881 | const Settings& settings) |
| 3882 | { |
| 3883 | ValueFlow::Value::Bound result = ValueFlow::Value::Bound::Point; |
| 3884 | const Token* next = start; |
| 3885 | while ((next = findExpressionChangedSkipDeadCode( |
| 3886 | var->nameToken(), next->next(), end, settings, &evaluateKnownValues))) { |
| 3887 | ValueFlow::Value::Bound b = ValueFlow::Value::Bound::Point; |
| 3888 | if (next->varId() != var->declarationId()) |
| 3889 | return ValueFlow::Value::Bound::Point; |
| 3890 | if (Token::simpleMatch(next->astParent(), "++")) |
| 3891 | b = ValueFlow::Value::Bound::Lower; |
| 3892 | else if (Token::simpleMatch(next->astParent(), "--")) |
| 3893 | b = ValueFlow::Value::Bound::Upper; |
| 3894 | else |
| 3895 | return ValueFlow::Value::Bound::Point; |
| 3896 | if (result == ValueFlow::Value::Bound::Point) |
| 3897 | result = b; |
| 3898 | else if (result != b) |
| 3899 | return ValueFlow::Value::Bound::Point; |
| 3900 | } |
| 3901 | return result; |
| 3902 | } |
| 3903 | |
| 3904 | static bool isInitialVarAssign(const Token* tok) |
| 3905 | { |
no test coverage detected