Uninitialized Variables: some additional tweaks. Try to fix Travis

This commit is contained in:
Daniel Marjamäki 2018-01-15 17:35:21 +01:00
parent 100887429d
commit f2b2e87fb6
1 changed files with 4 additions and 2 deletions

View File

@ -1290,6 +1290,7 @@ std::string CheckUninitVar::MyFileInfo::toString() const
ret << " <unsafefunctionarg"
<< " functionName=\"" << it->functionName << '\"'
<< " argnr=\"" << it->argnr << '\"'
<< " variableName=\"" << it->variableName << "\""
<< " fileName=\"" << it->location.fileName << '\"'
<< " linenr=\"" << it->location.linenr << '\"'
<< "/>\n";
@ -1298,6 +1299,7 @@ std::string CheckUninitVar::MyFileInfo::toString() const
ret << " <uninitializedFunctionArgs"
<< " functionName=\"" << it->functionName << '\"'
<< " argnr=\"" << it->argnr << '\"'
<< " variableName=\"" << it->variableName << "\""
<< " fileName=\"" << it->location.fileName << '\"'
<< " linenr=\"" << it->location.linenr << '\"'
<< "/>\n";
@ -1314,7 +1316,7 @@ Check::FileInfo *CheckUninitVar::getFileInfo(const Tokenizer *tokenizer, const S
// Parse all functions in TU
for (scope = symbolDatabase->scopeList.begin(); scope != symbolDatabase->scopeList.end(); ++scope) {
if (!scope->isExecutable() || scope->type != Scope::eFunction)
if (!scope->isExecutable() || scope->type != Scope::eFunction || !scope->function)
continue;
const Function *const function = scope->function;