From b74b94b1e6cb03c0edb8b3b073ddfdd5e568d71f Mon Sep 17 00:00:00 2001 From: PKEuS Date: Sun, 1 Feb 2015 12:33:53 +0100 Subject: [PATCH] Partially reverted previous commit - std::vetcor instance creation can't be avoided without generating lots of debug messages --- lib/valueflow.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 844e5b3a3..21dee71c5 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -1636,15 +1636,6 @@ static void valueFlowFunctionReturn(TokenList *tokenlist, ErrorLogger *errorLogg if (tok->str() != "(" || !tok->astOperand1() || !tok->astOperand1()->function()) continue; - // Get scope and args of function - const Function * const function = tok->astOperand1()->function(); - const Scope * const functionScope = function->functionScope; - if (!functionScope || !Token::simpleMatch(functionScope->classStart, "{ return")) { - if (functionScope && settings->debugwarnings) - bailout(tokenlist, errorLogger, tok, "function return; nontrivial function body"); - continue; - } - // Arguments.. std::vector parvalues; { @@ -1663,6 +1654,15 @@ static void valueFlowFunctionReturn(TokenList *tokenlist, ErrorLogger *errorLogg continue; } + // Get scope and args of function + const Function * const function = tok->astOperand1()->function(); + const Scope * const functionScope = function->functionScope; + if (!functionScope || !Token::simpleMatch(functionScope->classStart, "{ return")) { + if (functionScope && settings->debugwarnings) + bailout(tokenlist, errorLogger, tok, "function return; nontrivial function body"); + continue; + } + std::map programMemory; for (std::size_t i = 0; i < parvalues.size(); ++i) { const Variable * const arg = function->getArgumentVar(i);