@@ -5163,9 +5163,9 @@ struct SymbolicConditionHandler : SimpleConditionHandler {
51635163};
51645164
51655165static bool valueFlowForLoop2 (const Token *tok,
5166- ProgramMemory * memory1,
5167- ProgramMemory * memory2,
5168- ProgramMemory * memoryAfter,
5166+ ProgramMemory & memory1,
5167+ ProgramMemory & memory2,
5168+ ProgramMemory & memoryAfter,
51695169 const Settings& settings)
51705170{
51715171 // for ( firstExpression ; secondExpression ; thirdExpression )
@@ -5208,13 +5208,10 @@ static bool valueFlowForLoop2(const Token *tok,
52085208 }
52095209 // TODO: add bailout message
52105210
5211- if (memory1)
5212- memory1->swap (startMemory);
5211+ memory1.swap (startMemory);
52135212 if (!error) {
5214- if (memory2)
5215- memory2->swap (endMemory);
5216- if (memoryAfter)
5217- memoryAfter->swap (programMemory);
5213+ memory2.swap (endMemory);
5214+ memoryAfter.swap (programMemory);
52185215 }
52195216
52205217 return true ;
@@ -5389,7 +5386,7 @@ static void valueFlowForLoop(const TokenList &tokenlist, const SymbolDatabase& s
53895386 valueFlowForLoopSimplifyAfter (tok, varid, afterValue, tokenlist, errorLogger, settings);
53905387 } else {
53915388 ProgramMemory mem1, mem2, memAfter;
5392- if (valueFlowForLoop2 (tok, & mem1, & mem2, & memAfter, settings)) {
5389+ if (valueFlowForLoop2 (tok, mem1, mem2, memAfter, settings)) {
53935390 for (const auto & p : mem1) {
53945391 if (!p.second .isIntValue ())
53955392 continue ;
0 commit comments