valueFlowUninit: only check variables

This commit is contained in:
Daniel Marjamäki 2017-04-23 21:50:51 +02:00
parent 5eca129865
commit 2f51b975ed
1 changed files with 2 additions and 0 deletions

View File

@ -1208,6 +1208,8 @@ void CheckUninitVar::valueFlowUninit()
if (!scope->isExecutable())
continue;
for (const Token* tok = scope->classStart; tok != scope->classEnd; tok = tok->next()) {
if (!tok->variable())
continue;
if (tok->values().size() != 1U || tok->values().front().valueType != ValueFlow::Value::UNINIT)
continue;
if (!isVariableUsage(tok, tok->variable()->isPointer(), NO_ALLOC))