Use fixed number of iterations for valueflow loop (#2205)
This commit is contained in:
parent
9025b47f82
commit
1616282f6b
|
@ -6302,10 +6302,9 @@ void ValueFlow::setValues(TokenList *tokenlist, SymbolDatabase* symboldatabase,
|
|||
valueFlowSameExpressions(tokenlist);
|
||||
valueFlowFwdAnalysis(tokenlist, settings);
|
||||
|
||||
// Temporary hack.. run valueflow until there is nothing to update or timeout expires
|
||||
const std::time_t timeout = std::time(nullptr) + TIMEOUT;
|
||||
std::size_t values = 0;
|
||||
while (std::time(nullptr) < timeout && values < getTotalValues(tokenlist)) {
|
||||
std::size_t n = 4;
|
||||
while (n > 0 && values < getTotalValues(tokenlist)) {
|
||||
values = getTotalValues(tokenlist);
|
||||
valueFlowPointerAliasDeref(tokenlist);
|
||||
valueFlowArrayBool(tokenlist);
|
||||
|
@ -6328,6 +6327,7 @@ void ValueFlow::setValues(TokenList *tokenlist, SymbolDatabase* symboldatabase,
|
|||
valueFlowContainerAfterCondition(tokenlist, symboldatabase, errorLogger, settings);
|
||||
}
|
||||
valueFlowSafeFunctions(tokenlist, symboldatabase, errorLogger, settings);
|
||||
n--;
|
||||
}
|
||||
|
||||
valueFlowDynamicBufferSize(tokenlist, symboldatabase, errorLogger, settings);
|
||||
|
|
Loading…
Reference in New Issue