Bug hunting; Terminating analysis

This commit is contained in:
Daniel Marjamäki 2020-07-14 11:22:42 +02:00
parent 176826a1f5
commit 8d6fd4769b
1 changed files with 6 additions and 0 deletions

View File

@ -154,6 +154,7 @@ namespace {
const Token *tok;
const std::string what;
};
struct TerminateExpression {};
}
static std::string str(ExprEngine::ValuePtr val)
@ -2153,6 +2154,9 @@ static ExprEngine::ValuePtr executeStringLiteral(const Token *tok, Data &data)
static ExprEngine::ValuePtr executeExpression1(const Token *tok, Data &data)
{
if (data.settings->terminated())
throw TerminateExpression();
if (tok->str() == "return")
return executeReturn(tok, data);
@ -2489,6 +2493,8 @@ void ExprEngine::executeAllFunctions(ErrorLogger *errorLogger, const Tokenizer *
// FIXME.. there should not be exceptions
std::string functionName = functionScope->function->name();
std::cout << "Verify: Aborted analysis of function '" << functionName << "': " << e.what() << std::endl;
} catch (const TerminateExpression &) {
break;
}
}
}