TODO: return single value at most - no need for std::vector
| 7557 | |
| 7558 | // TODO: return single value at most - no need for std::vector |
| 7559 | std::vector<ValueFlow::Value> ValueFlow::isOutOfBounds(const Value& size, const Token* indexTok, bool possible) |
| 7560 | { |
| 7561 | ValueFlow::Value inBoundsValue = inferCondition("<", indexTok, size.intvalue); |
| 7562 | if (inBoundsValue.isKnown() && inBoundsValue.intvalue != 0) |
| 7563 | return {}; |
| 7564 | std::vector<ValueFlow::Value> result = isOutOfBoundsImpl(size, indexTok, false); |
| 7565 | if (!result.empty()) |
| 7566 | return result; |
| 7567 | if (!possible) |
| 7568 | return result; |
| 7569 | return isOutOfBoundsImpl(size, indexTok, true); |
| 7570 | } |
nothing calls this directly
no test coverage detected