CheckNullPointer: Reduced false negatives by making pattern more generic

This commit is contained in:
Daniel Marjamäki 2010-10-31 15:40:34 +01:00
parent 6faa4b79d3
commit 33d3fd4716
1 changed files with 2 additions and 2 deletions

View File

@ -118,10 +118,10 @@ bool CheckNullPointer::isPointerDeRef(const Token *tok, bool &unknown)
if (!Token::simpleMatch(tok->tokAt(-2), "& (") && Token::Match(tok->next(), ". %var%"))
return true;
if (Token::Match(tok->previous(), "[;{}=+-/(,] %var% [ %any% ]"))
if (Token::Match(tok->previous(), "[;{}=+-/(,] %var% ["))
return true;
if (Token::Match(tok->previous(), "return %var% [ %any% ]"))
if (Token::Match(tok->previous(), "return %var% ["))
return true;
if (Token::Match(tok, "%var% ("))