@@ -678,37 +678,6 @@ static void valueFlowArrayElement(TokenList& tokenlist, const Settings& settings
678678 }
679679}
680680
681- static void valueFlowBitAnd (TokenList &tokenlist, const Settings& settings)
682- {
683- for (Token *tok = tokenlist.front (); tok; tok = tok->next ()) {
684- if (tok->str () != " &" )
685- continue ;
686-
687- if (tok->hasKnownValue ())
688- continue ;
689-
690- if (!tok->astOperand1 () || !tok->astOperand2 ())
691- continue ;
692-
693- MathLib::bigint number;
694- if (MathLib::isInt (tok->astOperand1 ()->str ()))
695- number = MathLib::toBigNumber (tok->astOperand1 ()->str ());
696- else if (MathLib::isInt (tok->astOperand2 ()->str ()))
697- number = MathLib::toBigNumber (tok->astOperand2 ()->str ());
698- else
699- continue ;
700-
701- int bit = 0 ;
702- while (bit <= (MathLib::bigint_bits - 2 ) && ((((MathLib::bigint)1 ) << bit) < number))
703- ++bit;
704-
705- if ((((MathLib::bigint)1 ) << bit) == number) {
706- setTokenValue (tok, ValueFlow::Value (0 ), settings);
707- setTokenValue (tok, ValueFlow::Value (number), settings);
708- }
709- }
710- }
711-
712681static void valueFlowSameExpressions (TokenList &tokenlist, const Settings& settings)
713682{
714683 for (Token *tok = tokenlist.front (); tok; tok = tok->next ()) {
@@ -8416,7 +8385,7 @@ void ValueFlow::setValues(TokenList& tokenlist,
84168385 VFA (analyzePointerAlias (tokenlist, settings)),
84178386 VFA (valueFlowLifetime (tokenlist, errorLogger, settings)),
84188387 VFA (valueFlowSymbolic (tokenlist, symboldatabase, errorLogger, settings)),
8419- VFA (valueFlowBitAnd (tokenlist, settings)),
8388+ VFA (analyzeBitAnd (tokenlist, settings)),
84208389 VFA (valueFlowSameExpressions (tokenlist, settings)),
84218390 VFA (valueFlowConditionExpressions (tokenlist, symboldatabase, errorLogger, settings)),
84228391 });
0 commit comments