ExprEngine; Use 60s as default maxtime processing a function, the analysis time will be somewhat reasonable

This commit is contained in:
Daniel Marjamäki 2020-12-22 21:09:07 +01:00
parent 259f562e73
commit e4766c73dc
2 changed files with 1 additions and 7 deletions

View File

@ -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;
}

View File

@ -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),