Fixed #2764 (False positive: Uninitialized variable '&(x[0])')
This commit is contained in:
parent
9e97da8a57
commit
b9ee867344
|
@ -384,6 +384,7 @@ private:
|
|||
break;
|
||||
if (tok2->varId() &&
|
||||
!Token::Match(tok2->previous(), "&|::") &&
|
||||
!Token::simpleMatch(tok2->tokAt(-2), "& (") &&
|
||||
!Token::simpleMatch(tok2->next(), "="))
|
||||
{
|
||||
// Multiple assignments..
|
||||
|
|
|
@ -958,6 +958,12 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
checkUninitVar("void f() {\n"
|
||||
" char a[10], *p;\n"
|
||||
" p = &(a[10]);\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
checkUninitVar("void f()\n"
|
||||
"{\n"
|
||||
" char c[50] = \"\";\n"
|
||||
|
|
Loading…
Reference in New Issue