mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 11:08:20 +00:00
Make ClosureFrame safe & cleanup
TODO: make anonymous-funcs associated with tables capture closures, implement copy constructor for Frame, & other cleanup.
This commit is contained in:
parent
670816ad48
commit
8ed18ca194
10 changed files with 150 additions and 149 deletions
20
src/Expr.h
20
src/Expr.h
|
@ -943,7 +943,7 @@ public:
|
|||
|
||||
protected:
|
||||
friend class Expr;
|
||||
CallExpr() { func = 0; args = 0; }
|
||||
CallExpr() { func = 0; args = 0; }
|
||||
|
||||
void ExprDescribe(ODesc* d) const override;
|
||||
|
||||
|
@ -951,16 +951,16 @@ protected:
|
|||
ListExpr* args;
|
||||
};
|
||||
|
||||
/*
|
||||
Class to handle the creation of anonymous functions with closures.
|
||||
|
||||
Facts:
|
||||
- LambdaExpr creates a new BroFunc on every call to Eval.
|
||||
- LambdaExpr must be given all the information to create a BroFunc on
|
||||
construction except for the closure.
|
||||
- The closure for created BroFuncs is the frame that the LambdaExpr is
|
||||
evaluated in.
|
||||
*/
|
||||
// Class to handle the creation of anonymous functions with closures.
|
||||
|
||||
// Facts:
|
||||
// - LambdaExpr creates a new BroFunc on every call to Eval.
|
||||
// - LambdaExpr must be given all the information to create a BroFunc on
|
||||
// construction except for the closure.
|
||||
// - The closure for created BroFuncs is the frame that the LambdaExpr is
|
||||
// evaluated in.
|
||||
|
||||
class LambdaExpr : public Expr {
|
||||
public:
|
||||
LambdaExpr(std::unique_ptr<function_ingredients> ingredients,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue