From ae44419845f53d465f23d0377fd52b03c5bcff29 Mon Sep 17 00:00:00 2001 From: chrchr-github Date: Sun, 6 Aug 2023 13:41:39 +0200 Subject: [PATCH] Check all indirections --- lib/valueflow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 572497915a4..df1c062ec79 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -2578,8 +2578,9 @@ struct ValueFlowAnalyzer : Analyzer { ++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; }