mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
gracefully deal with "eval" exceptions that occur during AST reduction
This commit is contained in:
parent
9a429808ab
commit
b7c9940221
2 changed files with 15 additions and 5 deletions
|
@ -14,6 +14,20 @@
|
||||||
|
|
||||||
namespace zeek::detail {
|
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)
|
ExprPtr Reducer::GenTemporaryExpr(const TypePtr& t, ExprPtr rhs)
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,11 +18,7 @@ class Reducer {
|
||||||
public:
|
public:
|
||||||
Reducer() { }
|
Reducer() { }
|
||||||
|
|
||||||
StmtPtr Reduce(StmtPtr s)
|
StmtPtr Reduce(StmtPtr s);
|
||||||
{
|
|
||||||
reduction_root = std::move(s);
|
|
||||||
return reduction_root->Reduce(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
const DefSetsMgr* GetDefSetsMgr() const { return mgr; }
|
const DefSetsMgr* GetDefSetsMgr() const { return mgr; }
|
||||||
void SetDefSetsMgr(const DefSetsMgr* _mgr) { mgr = _mgr; }
|
void SetDefSetsMgr(const DefSetsMgr* _mgr) { mgr = _mgr; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue