diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index cf3cdb561876..d0b1ad7e9d40 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -2576,8 +2576,9 @@ struct ValueFlowAnalyzer : Analyzer { if (vt->type == ValueType::ITERATOR) ++indirect; } - if (isVariableChanged(tok, indirect, getSettings(), isCPP())) - return Action::Invalid; + for (int i = 0; i <= indirect; ++i) + if (isVariableChanged(tok, i, getSettings(), isCPP())) + return Action::Invalid; return Action::None; }