diff --git a/src/Trigger.cc b/src/Trigger.cc index 9d4e2ea121..0ce780ef38 100644 --- a/src/Trigger.cc +++ b/src/Trigger.cc @@ -102,7 +102,7 @@ protected: Trigger::Trigger(ExprPtr cond, StmtPtr body, StmtPtr timeout_stmts, ExprPtr timeout_expr, Frame* frame, bool is_return, const Location* location) { - GetTimeout(timeout_expr); + GetTimeout(timeout_expr, frame); Init(cond, body, timeout_stmts, frame, is_return, location); } @@ -120,12 +120,12 @@ Trigger::Trigger(WhenInfo* wi, const IDSet& _globals, std::vector _local local_aggrs = std::move(_local_aggrs); have_trigger_elems = true; - GetTimeout(wi->TimeoutExpr()); + GetTimeout(wi->TimeoutExpr(), f); Init(wi->Cond(), wi->WhenBody(), wi->TimeoutStmt(), f, wi->IsReturn(), loc); } -void Trigger::GetTimeout(const ExprPtr& timeout_expr) +void Trigger::GetTimeout(const ExprPtr& timeout_expr, Frame* f) { timeout_value = -1.0; @@ -135,7 +135,7 @@ void Trigger::GetTimeout(const ExprPtr& timeout_expr) try { - timeout_val = timeout_expr->Eval(frame); + timeout_val = timeout_expr->Eval(f); } catch ( InterpreterException& ) { /* Already reported */ diff --git a/src/Trigger.h b/src/Trigger.h index 6810a7fccd..833b3f05bc 100644 --- a/src/Trigger.h +++ b/src/Trigger.h @@ -112,7 +112,7 @@ public: private: friend class TriggerTimer; - void GetTimeout(const ExprPtr& timeout_expr); + void GetTimeout(const ExprPtr& timeout_expr, Frame* f); void Init(ExprPtr cond, StmtPtr body, StmtPtr timeout_stmts, Frame* frame, bool is_return, const Location* location);