Fix Token::isImpossibleIntValue

This commit is contained in:
Daniel Marjamäki 2020-05-09 10:30:19 +02:00
parent 296a0adc97
commit 137f262300
1 changed files with 3 additions and 2 deletions

View File

@ -1038,11 +1038,12 @@ public:
for (const auto &v: *mImpl->mValues) {
if (v.isIntValue() && v.isImpossible() && v.intvalue == val)
return true;
if (v.isIntValue() && v.bound == ValueFlow::Value::Bound::Lower && v.intvalue > val)
if (v.isIntValue() && v.bound == ValueFlow::Value::Bound::Lower && val > v.intvalue)
return true;
if (v.isIntValue() && v.bound == ValueFlow::Value::Bound::Upper && v.intvalue < val)
if (v.isIntValue() && v.bound == ValueFlow::Value::Bound::Upper && val < v.intvalue)
return true;
}
return false;
}
const ValueFlow::Value * getValue(const MathLib::bigint val) const {