Fixed #3126 (false positive: Null pointer dereference)

This commit is contained in:
Daniel Marjamäki 2011-10-02 18:24:45 +02:00
parent 06f9d310ce
commit b2d0e48a31
2 changed files with 6 additions and 1 deletions

View File

@ -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; std::list<const Token *> var;
parseFunctionCall(*tok, var, 0); parseFunctionCall(*tok, var, 0);

View File

@ -1250,6 +1250,11 @@ private:
"}\n"); "}\n");
ASSERT_EQUALS("", errout.str()); 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() void gcc_statement_expression()