Fixed #1268 (Null pointer dereference false positive)
This commit is contained in:
parent
bc5800004b
commit
a7bddc8fd3
|
@ -1278,6 +1278,9 @@ private:
|
|||
|
||||
if (Token::Match(&tok, "%var% ("))
|
||||
{
|
||||
if (tok.str() == "sizeof")
|
||||
return tok.next()->link();
|
||||
|
||||
// parse usage..
|
||||
std::list<const Token *> var;
|
||||
parseFunctionCall(tok, var, 0);
|
||||
|
|
|
@ -970,6 +970,12 @@ private:
|
|||
" p->do_something();\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
checkNullPointer("void foo()\n"
|
||||
"{\n"
|
||||
" int sz = sizeof((*(struct dummy *)0).x);\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void nullpointer7()
|
||||
|
|
Loading…
Reference in New Issue