Skip to content

Commit 4ac5c78

Browse files
committed
Fix wrong iterator usage. Iterator that is erased must be non-const.
1 parent 72e4bc9 commit 4ac5c78

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/valueflow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ static bool valueFlowForward(Token * const startToken,
14671467
const Token * const arg = tok2->next()->astOperand2();
14681468
if (arg != nullptr && arg->str() != ",") {
14691469
// Should scope be skipped because variable value is checked?
1470-
for (std::list<ValueFlow::Value>::const_iterator it = values.begin(); it != values.end();) {
1470+
for (std::list<ValueFlow::Value>::iterator it = values.begin(); it != values.end();) {
14711471
if (conditionIsFalse(arg, getProgramMemory(tok2, varid, *it)))
14721472
values.erase(it++);
14731473
else

0 commit comments

Comments
 (0)