Fix Coverity CID1490221 warning. settings is dereferenced and then checked.

This commit is contained in:
Daniel Marjamäki 2022-07-05 07:46:39 +02:00
parent d8239b26f1
commit 29402b4d1a
1 changed files with 1 additions and 2 deletions

View File

@ -986,8 +986,7 @@ static void setTokenValue(Token* tok,
ValueFlow::Value v(val);
v.intvalue = ~v.intvalue;
int bits = 0;
if (settings &&
tok->valueType() &&
if (tok->valueType() &&
tok->valueType()->sign == ValueType::Sign::UNSIGNED &&
tok->valueType()->pointer == 0) {
if (tok->valueType()->type == ValueType::Type::INT)