Skip to content

Commit

Permalink
valueflow.cpp: adjusted checks in valueFlowRightShift()
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Jan 19, 2025
1 parent 93910d3 commit e5986ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -935,16 +935,16 @@ static void valueFlowRightShift(TokenList& tokenList, const Settings& settings)
if (tok->str() != ">>")
continue;

if (tok->hasKnownValue())
if (tok->hasKnownIntValue())
continue;

if (!tok->astOperand1() || !tok->astOperand2())
continue;

if (!tok->astOperand2()->hasKnownValue())
if (!tok->astOperand2()->hasKnownIntValue())
continue;

const MathLib::bigint rhsvalue = tok->astOperand2()->getKnownValue()->intvalue;
const MathLib::bigint rhsvalue = tok->astOperand2()->getKnownIntValue();
if (rhsvalue < 0)
continue;

Expand Down

0 comments on commit e5986ed

Please sign in to comment.