Fixed #1209 (False positive: uninitialized variable c when it is initialized with 'ab(sizeof(xyz), &c)')
This commit is contained in:
parent
bcafb30d0d
commit
d82079e86f
|
@ -1660,7 +1660,7 @@ private:
|
||||||
|
|
||||||
else if (Token::simpleMatch(tok2, "sizeof ("))
|
else if (Token::simpleMatch(tok2, "sizeof ("))
|
||||||
{
|
{
|
||||||
tok2 = tok2->link();
|
tok2 = tok2->next()->link();
|
||||||
if (!tok2)
|
if (!tok2)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1148,6 +1148,14 @@ private:
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
checkUninitVar("void f()\n"
|
||||||
|
"{\n"
|
||||||
|
" int c;\n"
|
||||||
|
" ab(sizeof(xyz), &c);\n"
|
||||||
|
" if (c);\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
// goto..
|
// goto..
|
||||||
checkUninitVar("void foo(int x)\n"
|
checkUninitVar("void foo(int x)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
|
|
Loading…
Reference in New Issue