@@ -1317,42 +1317,6 @@ static void valueFlowPointerAlias(TokenList *tokenlist)
13171317 }
13181318}
13191319
1320- static void valueFlowUninitPointerAliasDeref (TokenList *tokenlist)
1321- {
1322- for (Token *tok = tokenlist->front (); tok; tok = tok->next ()) {
1323- if (!tok->isUnaryOp (" *" ))
1324- continue ;
1325- if (!astIsPointer (tok->astOperand1 ()))
1326- continue ;
1327-
1328- const Token* lifeTok = nullptr ;
1329- ErrorPath errorPath;
1330- for (const ValueFlow::Value& v:tok->astOperand1 ()->values ()) {
1331- if (!v.isLocalLifetimeValue ())
1332- continue ;
1333- lifeTok = v.tokvalue ;
1334- errorPath = v.errorPath ;
1335- }
1336- if (!lifeTok)
1337- continue ;
1338- if (lifeTok->varId () == 0 )
1339- continue ;
1340- const Variable * var = lifeTok->variable ();
1341- if (!var)
1342- continue ;
1343- if (!var->isConst () && isVariableChanged (lifeTok->next (), tok, lifeTok->varId (), !var->isLocal (), tokenlist->getSettings (), tokenlist->isCPP ()))
1344- continue ;
1345- for (const ValueFlow::Value& v:lifeTok->values ()) {
1346- // Forward uninit values since not all values can be forwarded directly
1347- if (!v.isUninitValue ())
1348- continue ;
1349- ValueFlow::Value value = v;
1350- value.errorPath .insert (value.errorPath .begin (), errorPath.begin (), errorPath.end ());
1351- setTokenValue (tok, value, tokenlist->getSettings ());
1352- }
1353- }
1354- }
1355-
13561320static void valueFlowBitAnd (TokenList *tokenlist)
13571321{
13581322 for (Token *tok = tokenlist->front (); tok; tok = tok->next ()) {
@@ -7698,7 +7662,6 @@ void ValueFlow::setValues(TokenList *tokenlist, SymbolDatabase* symboldatabase,
76987662 valueFlowLifetime (tokenlist, symboldatabase, errorLogger, settings);
76997663 valueFlowFunctionDefaultParameter (tokenlist, symboldatabase, settings);
77007664 valueFlowUninit (tokenlist, symboldatabase, settings);
7701- valueFlowUninitPointerAliasDeref (tokenlist);
77027665 if (tokenlist->isCPP ()) {
77037666 valueFlowAfterMove (tokenlist, symboldatabase, settings);
77047667 valueFlowSmartPointer (tokenlist, errorLogger, settings);
0 commit comments