From ba2b235e24d6f118528fa405c614323dc9ce13da Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Mon, 22 May 2017 15:22:38 +0200 Subject: [PATCH] =?UTF-8?q?Fixed:=20warning:=20=E2=80=98tokvalue=E2=80=99?= =?UTF-8?q?=20may=20be=20used=20uninitialized=20in=20this=20function=20[-W?= =?UTF-8?q?uninitialized].?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/valueflow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 8db580151..310f8bdba 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -36,7 +36,7 @@ namespace { bool getIntValue(unsigned int varid, MathLib::bigint* result) const { const std::map::const_iterator it = values.find(varid); - bool found = it != values.end() && it->second.isIntValue(); + const bool found = it != values.end() && it->second.isIntValue(); if (found) *result = it->second.intvalue; return found; @@ -48,7 +48,7 @@ namespace { bool getTokValue(unsigned int varid, const Token** result) const { const std::map::const_iterator it = values.find(varid); - bool found = it != values.end() && it->second.isTokValue(); + const bool found = it != values.end() && it->second.isTokValue(); if (found) *result = it->second.tokvalue; return found; @@ -2309,7 +2309,7 @@ static void execute(const Token *expr, } else if (expr->str() == "[" && expr->astOperand1() && expr->astOperand2()) { - const Token *tokvalue; + const Token *tokvalue = nullptr; if (!programMemory->getTokValue(expr->astOperand1()->varId(), &tokvalue)) { if (expr->astOperand1()->values().size() != 1U || !expr->astOperand1()->values().front().isTokValue()) { *error = true;