Fixed #2284 (False positive: Possible null pointer reference)
This commit is contained in:
parent
4d2c210f2a
commit
ee083cd7a0
|
@ -742,6 +742,9 @@ private:
|
|||
dereference(checks, *it);
|
||||
}
|
||||
|
||||
else if (Token::simpleMatch(&tok, "( 0 &&"))
|
||||
return tok.link();
|
||||
|
||||
if (tok.varId() != 0)
|
||||
{
|
||||
bool unknown = false;
|
||||
|
|
|
@ -513,6 +513,12 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void f() {\n"
|
||||
" Foo *p = 0;\n"
|
||||
" bool b = (p && (p->type() == 1));\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void foo()\n"
|
||||
"{\n"
|
||||
" int sz = sizeof((*(struct dummy *)0).x);\n"
|
||||
|
|
Loading…
Reference in New Issue