gracefully deal with "eval" exceptions that occur during AST reduction

This commit is contained in:
Vern Paxson 2021-05-30 17:48:14 -07:00
parent 9a429808ab
commit b7c9940221
2 changed files with 15 additions and 5 deletions

View file

@ -14,6 +14,20 @@
namespace zeek::detail {
StmtPtr Reducer::Reduce(StmtPtr s)
{
reduction_root = std::move(s);
try
{
return reduction_root->Reduce(this);
}
catch ( InterpreterException& e )
{
/* Already reported. */
return reduction_root;
}
}
ExprPtr Reducer::GenTemporaryExpr(const TypePtr& t, ExprPtr rhs)
{