Fixed #2331 (Token::Match is called with varid 0)
This commit is contained in:
parent
02892499d2
commit
c0bedb5036
|
@ -318,6 +318,8 @@ void CheckNullPointer::nullPointerStructByDeRefAndChec()
|
||||||
// Is the function return value taken by the pointer?
|
// Is the function return value taken by the pointer?
|
||||||
bool assignment = false;
|
bool assignment = false;
|
||||||
const unsigned int varid1(tok1->varId());
|
const unsigned int varid1(tok1->varId());
|
||||||
|
if (varid1 == 0)
|
||||||
|
continue;
|
||||||
const Token *tok2 = tok1->previous();
|
const Token *tok2 = tok1->previous();
|
||||||
while (tok2 && !Token::Match(tok2, "[;{}]"))
|
while (tok2 && !Token::Match(tok2, "[;{}]"))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue