From f2b2e87fb6d992c538150973e177d7928ad60180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 15 Jan 2018 17:35:21 +0100 Subject: [PATCH] Uninitialized Variables: some additional tweaks. Try to fix Travis --- lib/checkuninitvar.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/checkuninitvar.cpp b/lib/checkuninitvar.cpp index 2ca53049d..099bcd018 100644 --- a/lib/checkuninitvar.cpp +++ b/lib/checkuninitvar.cpp @@ -1290,6 +1290,7 @@ std::string CheckUninitVar::MyFileInfo::toString() const ret << " 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 << " 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; @@ -1395,7 +1397,7 @@ Check::FileInfo * CheckUninitVar::loadFileInfoFromXml(const tinyxml2::XMLElement bool CheckUninitVar::analyseWholeProgram(const std::list &fileInfo, const Settings& settings, ErrorLogger &errorLogger) { - (void)settings; // This argument is unused + (void)settings; // This argument is unused // Merge all fileinfo.. MyFileInfo all;