Partially reverted previous commit - std::vetcor instance creation can't be avoided without generating lots of debug messages
This commit is contained in:
parent
58c3fdd063
commit
b74b94b1e6
|
@ -1636,15 +1636,6 @@ static void valueFlowFunctionReturn(TokenList *tokenlist, ErrorLogger *errorLogg
|
||||||
if (tok->str() != "(" || !tok->astOperand1() || !tok->astOperand1()->function())
|
if (tok->str() != "(" || !tok->astOperand1() || !tok->astOperand1()->function())
|
||||||
continue;
|
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..
|
// Arguments..
|
||||||
std::vector<MathLib::bigint> parvalues;
|
std::vector<MathLib::bigint> parvalues;
|
||||||
{
|
{
|
||||||
|
@ -1663,6 +1654,15 @@ static void valueFlowFunctionReturn(TokenList *tokenlist, ErrorLogger *errorLogg
|
||||||
continue;
|
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<unsigned int, MathLib::bigint> programMemory;
|
std::map<unsigned int, MathLib::bigint> programMemory;
|
||||||
for (std::size_t i = 0; i < parvalues.size(); ++i) {
|
for (std::size_t i = 0; i < parvalues.size(); ++i) {
|
||||||
const Variable * const arg = function->getArgumentVar(i);
|
const Variable * const arg = function->getArgumentVar(i);
|
||||||
|
|
Loading…
Reference in New Issue