From 6e69b751eb5a02b509c19c1e97ecf000fd8efbaa Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Fri, 15 Apr 2022 08:48:49 +0200 Subject: [PATCH] Fix Match pattern (#4025) --- lib/valueflow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 764bc63cd..b6ccd4aac 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -1098,7 +1098,7 @@ static Token * valueFlowSetConstantValue(Token *tok, const Settings *settings, b sz1->variable()->isArray() && !sz1->variable()->dimensions().empty() && sz1->variable()->dimensionKnown(0) && - Token::Match(sz2->astOperand2(), "*|[") && Token::Match(sz2->astOperand2()->astOperand1(), "%var%", varid1)) { + Token::Match(sz2->astOperand2(), "*|[") && Token::Match(sz2->astOperand2()->astOperand1(), "%varid%", varid1)) { ValueFlow::Value value(sz1->variable()->dimension(0)); if (!tok2->isTemplateArg() && settings->platformType != cppcheck::Platform::Unspecified) value.setKnown();