Bug hunting; Fixed timeout

This commit is contained in:
Daniel Marjamäki 2020-12-18 20:41:10 +01:00
parent 1b0ca0811f
commit 62a11f6490
2 changed files with 3 additions and 7 deletions

View File

@ -2428,9 +2428,7 @@ static std::string execute(const Token *start, const Token *end, Data &data)
};
Recursion updateRecursion(&data.recursion, data.recursion);
const std::time_t stopTime = (data.settings->bugHuntingCheckFunctionMaxTime > 0) ?
(data.startTime + data.settings->bugHuntingCheckFunctionMaxTime) :
~0ULL;
const std::time_t stopTime = data.startTime + data.settings->bugHuntingCheckFunctionMaxTime;
for (const Token *tok = start; tok != end; tok = tok->next()) {
if (Token::Match(tok, "[;{}]")) {
@ -2856,9 +2854,7 @@ void ExprEngine::executeFunction(const Scope *functionScope, ErrorLogger *errorL
data.contractConstraints(function, executeExpression1);
const std::time_t stopTime = (data.settings->bugHuntingCheckFunctionMaxTime > 0) ?
(data.startTime + data.settings->bugHuntingCheckFunctionMaxTime) :
~0ULL;
const std::time_t stopTime = data.startTime + data.settings->bugHuntingCheckFunctionMaxTime;
try {
execute(functionScope->bodyStart, functionScope->bodyEnd, data);

View File

@ -31,7 +31,7 @@ const char Settings::SafeChecks::XmlExternalVariables[] = "external-variables";
Settings::Settings()
: mEnabled(0),
bugHunting(false),
bugHuntingCheckFunctionMaxTime(0),
bugHuntingCheckFunctionMaxTime(INT_MAX),
checkAllConfigurations(true),
checkConfiguration(false),
checkHeaders(true),