Skip to content

Commit

Permalink
Skip literals
Browse files Browse the repository at this point in the history
  • Loading branch information
pfultz2 committed Feb 20, 2021
1 parent d7d4c44 commit 56a1408
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ static void setTokenValueCast(Token *parent, const ValueType &valueType, const V
/** set ValueFlow value and perform calculations if possible */
static void setTokenValue(Token* tok, const ValueFlow::Value &value, const Settings *settings)
{
if (!value.isImpossible() && value.isIntValue() && value.intvalue < 0 && astIsUnsigned(tok))
// Skip setting values that are too big since its ambiguous
if (!value.isImpossible() && value.isIntValue() && value.intvalue < 0 && astIsUnsigned(tok) && !tok->isLiteral())
return;
if (!tok->addValue(value))
return;
Expand Down

0 comments on commit 56a1408

Please sign in to comment.