From 7d12e1f3a652c088cba2d59b7735837af2472b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 8 Apr 2017 15:49:56 +0200 Subject: [PATCH] valueFlowGetArrayIndexes: convert Token::Match to Token::simpleMatch. The pattern is a sole "[", but since "[" is also used for complexe patterns, the internal check that finds potential simple match patterns bailed out here. --- lib/checkbufferoverrun.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index 6db8a0c06..9c37e6baa 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -763,7 +763,7 @@ static std::vector valueFlowGetArrayIndexes(const Token * cons unsigned int indexvarid = 0; const std::vector empty; std::vector indexes; - for (const Token *tok2 = tok; indexes.size() < dimensions && Token::Match(tok2, "["); tok2 = tok2->link()->next()) { + for (const Token *tok2 = tok; indexes.size() < dimensions && Token::simpleMatch(tok2, "["); tok2 = tok2->link()->next()) { if (!tok2->astOperand2()) return empty;