Fixed #1153 (False positive: uninitialized data for reinterpret_cast)
This commit is contained in:
parent
afad0205c4
commit
fbfe5a4bd1
|
@ -1415,7 +1415,7 @@ private:
|
|||
CheckUninitVar *c = dynamic_cast<CheckUninitVar *>(*it);
|
||||
if (c && c->varId == varid)
|
||||
{
|
||||
if (mode == 0 && c->array)
|
||||
if (mode == 0 && (c->array || (c->pointer && c->alloc)))
|
||||
continue;
|
||||
if (mode == 2 && !c->pointer)
|
||||
continue;
|
||||
|
|
|
@ -1080,6 +1080,13 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
checkUninitVar("void foo()\n"
|
||||
"{\n"
|
||||
" char *buf = malloc(100);\n"
|
||||
" struct ABC *abc = buf;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// goto..
|
||||
checkUninitVar("void foo(int x)\n"
|
||||
"{\n"
|
||||
|
|
Loading…
Reference in New Issue