Fixed #3126 (false positive: Null pointer dereference)
This commit is contained in:
parent
06f9d310ce
commit
b2d0e48a31
|
@ -866,7 +866,7 @@ void CheckNullPointer::nullConstantDereference()
|
|||
}
|
||||
}
|
||||
|
||||
else if (indentlevel > 0 && Token::Match(tok, "%var% ("))
|
||||
else if (indentlevel > 0 && Token::Match(tok->previous(), "[={};] %var% ("))
|
||||
{
|
||||
std::list<const Token *> var;
|
||||
parseFunctionCall(*tok, var, 0);
|
||||
|
|
|
@ -1250,6 +1250,11 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// Ticket #3126 - don't confuse member function with standard function
|
||||
check("void f() {\n"
|
||||
" image1.fseek(0, SEEK_SET);\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void gcc_statement_expression()
|
||||
|
|
Loading…
Reference in New Issue