Fixed #2331 (Token::Match is called with varid 0)

This commit is contained in:
Daniel Marjamäki 2010-12-19 21:27:28 +01:00
parent 02892499d2
commit c0bedb5036
1 changed files with 2 additions and 0 deletions

View File

@ -318,6 +318,8 @@ void CheckNullPointer::nullPointerStructByDeRefAndChec()
// Is the function return value taken by the pointer?
bool assignment = false;
const unsigned int varid1(tok1->varId());
if (varid1 == 0)
continue;
const Token *tok2 = tok1->previous();
while (tok2 && !Token::Match(tok2, "[;{}]"))
{