From e4766c73dce8c57c608b79ec4db84b55024b1a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 22 Dec 2020 21:09:07 +0100 Subject: [PATCH] ExprEngine; Use 60s as default maxtime processing a function, the analysis time will be somewhat reasonable --- lib/exprengine.cpp | 6 ------ lib/settings.cpp | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/exprengine.cpp b/lib/exprengine.cpp index 5a0d47810..b4348bdcf 100644 --- a/lib/exprengine.cpp +++ b/lib/exprengine.cpp @@ -2647,15 +2647,9 @@ static std::string execute(const Token *start, const Token *end, Data &data) caseData.addConstraint(condValue, caseValue, true); defaultData.addConstraint(condValue, caseValue, false); exec(tok2->tokAt(2), end, caseData); - // After 1 minute processing a function.. only check first case.. - if (std::time(nullptr) > data.startTime + 60) - break; } else if (Token::Match(tok2, "case %name% :") && !Token::Match(tok2->tokAt(3), ";| case")) { Data caseData(data); exec(tok2->tokAt(2), end, caseData); - // After 1 minute processing a function.. only check first case.. - if (std::time(nullptr) > data.startTime + 60) - break; } else if (Token::simpleMatch(tok2, "default :")) defaultStart = tok2; } diff --git a/lib/settings.cpp b/lib/settings.cpp index f891c7d7d..c3a8b64ed 100644 --- a/lib/settings.cpp +++ b/lib/settings.cpp @@ -31,7 +31,7 @@ const char Settings::SafeChecks::XmlExternalVariables[] = "external-variables"; Settings::Settings() : mEnabled(0), bugHunting(false), - bugHuntingCheckFunctionMaxTime(INT_MAX), + bugHuntingCheckFunctionMaxTime(60), checkAllConfigurations(true), checkConfiguration(false), checkHeaders(true),