Fixed #2367 (false positive: (error) Uninitialized variable: s)

This commit is contained in:
Daniel Marjamäki 2010-12-27 21:18:36 +01:00
parent 448c03c6e6
commit d4e3e7e201
2 changed files with 7 additions and 1 deletions

View File

@ -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)

View File

@ -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());
}
};