@@ -668,37 +668,6 @@ static void valueFlowArrayElement(TokenList& tokenlist, const Settings& settings
668668 }
669669}
670670
671- static void valueFlowBitAnd (TokenList &tokenlist, const Settings& settings)
672- {
673- for (Token *tok = tokenlist.front (); tok; tok = tok->next ()) {
674- if (tok->str () != " &" )
675- continue ;
676-
677- if (tok->hasKnownValue ())
678- continue ;
679-
680- if (!tok->astOperand1 () || !tok->astOperand2 ())
681- continue ;
682-
683- MathLib::bigint number;
684- if (MathLib::isInt (tok->astOperand1 ()->str ()))
685- number = MathLib::toBigNumber (tok->astOperand1 ()->str ());
686- else if (MathLib::isInt (tok->astOperand2 ()->str ()))
687- number = MathLib::toBigNumber (tok->astOperand2 ()->str ());
688- else
689- continue ;
690-
691- int bit = 0 ;
692- while (bit <= (MathLib::bigint_bits - 2 ) && ((((MathLib::bigint)1 ) << bit) < number))
693- ++bit;
694-
695- if ((((MathLib::bigint)1 ) << bit) == number) {
696- setTokenValue (tok, ValueFlow::Value (0 ), settings);
697- setTokenValue (tok, ValueFlow::Value (number), settings);
698- }
699- }
700- }
701-
702671static void valueFlowSameExpressions (TokenList &tokenlist, const Settings& settings)
703672{
704673 for (Token *tok = tokenlist.front (); tok; tok = tok->next ()) {
@@ -8412,7 +8381,7 @@ void ValueFlow::setValues(TokenList& tokenlist,
84128381 VFA (analyzePointerAlias (tokenlist, settings)),
84138382 VFA (valueFlowLifetime (tokenlist, errorLogger, settings)),
84148383 VFA (valueFlowSymbolic (tokenlist, symboldatabase, errorLogger, settings)),
8415- VFA (valueFlowBitAnd (tokenlist, settings)),
8384+ VFA (analyzeBitAnd (tokenlist, settings)),
84168385 VFA (valueFlowSameExpressions (tokenlist, settings)),
84178386 VFA (valueFlowConditionExpressions (tokenlist, symboldatabase, errorLogger, settings)),
84188387 });
0 commit comments