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.
This commit is contained in:
Matthias Krüger 2017-04-08 15:49:56 +02:00
parent efae089b10
commit 7d12e1f3a6
1 changed files with 1 additions and 1 deletions

View File

@ -763,7 +763,7 @@ static std::vector<ValueFlow::Value> valueFlowGetArrayIndexes(const Token * cons
unsigned int indexvarid = 0;
const std::vector<ValueFlow::Value> empty;
std::vector<ValueFlow::Value> 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;