We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
hasKnownIntValue()
1 parent 089812b commit c9a04daCopy full SHA for c9a04da
lib/checkcondition.cpp
@@ -1700,7 +1700,7 @@ void CheckCondition::checkInvalidTestForOverflow()
1700
const Token * const other = expr->astSibling();
1701
1702
// x [+-] c cmp x
1703
- if ((other->isNumber() && other->getKnownIntValue() > 0) ||
+ if ((other->isNumber() && other->hasKnownIntValue() && other->getKnownIntValue() > 0) ||
1704
(!other->isNumber() && other->valueType() && other->valueType()->isIntegral() && other->valueType()->sign == ValueType::Sign::UNSIGNED)) {
1705
bool result;
1706
if (lhs->str() == "+")
0 commit comments