Fix wrong iterator usage. Iterator that is erased must be non-const.
This commit is contained in:
parent
72e4bc9d88
commit
4ac5c78e0c
|
@ -1467,7 +1467,7 @@ static bool valueFlowForward(Token * const startToken,
|
|||
const Token * const arg = tok2->next()->astOperand2();
|
||||
if (arg != nullptr && arg->str() != ",") {
|
||||
// Should scope be skipped because variable value is checked?
|
||||
for (std::list<ValueFlow::Value>::const_iterator it = values.begin(); it != values.end();) {
|
||||
for (std::list<ValueFlow::Value>::iterator it = values.begin(); it != values.end();) {
|
||||
if (conditionIsFalse(arg, getProgramMemory(tok2, varid, *it)))
|
||||
values.erase(it++);
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue