Fixed #2367 (false positive: (error) Uninitialized variable: s)
This commit is contained in:
parent
448c03c6e6
commit
d4e3e7e201
|
@ -649,7 +649,7 @@ private:
|
|||
--parlevel;
|
||||
}
|
||||
|
||||
else if (Token::simpleMatch(tok2, "sizeof ("))
|
||||
else if (Token::Match(tok2, "sizeof|typeof ("))
|
||||
{
|
||||
tok2 = tok2->next()->link();
|
||||
if (!tok2)
|
||||
|
|
|
@ -1400,6 +1400,12 @@ private:
|
|||
" typeof(fred->x);\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
checkUninitVar("void f() {\n"
|
||||
" struct SData * s;\n"
|
||||
" ab(typeof(s->status));\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue