mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
Table defaults capture closures.
This commit is contained in:
parent
d7a73c270d
commit
28253b24f9
13 changed files with 459 additions and 364 deletions
11
src/Func.cc
11
src/Func.cc
|
@ -328,10 +328,7 @@ Val* BroFunc::Call(val_list* args, Frame* parent) const
|
|||
|
||||
Frame* f = new Frame(frame_size, this, args);
|
||||
if ( closure )
|
||||
{
|
||||
assert(outer_ids);
|
||||
f = new ClosureFrame(this->closure, f, this->outer_ids);
|
||||
}
|
||||
|
||||
// Hand down any trigger.
|
||||
if ( parent )
|
||||
|
@ -485,7 +482,6 @@ void BroFunc::AddBody(Stmt* new_body, id_list* new_inits, int new_frame_size,
|
|||
|
||||
void BroFunc::AddClosure(std::shared_ptr<id_list> ids, Frame* f)
|
||||
{
|
||||
// Order matters here.
|
||||
this->SetOuterIDs(ids);
|
||||
this->SetClosureFrame(f);
|
||||
}
|
||||
|
@ -515,11 +511,8 @@ Func* BroFunc::DoClone()
|
|||
|
||||
other->frame_size = frame_size;
|
||||
|
||||
if (closure)
|
||||
{
|
||||
other->closure = closure->Clone();
|
||||
other->outer_ids = outer_ids;
|
||||
}
|
||||
other->closure = closure->Clone();
|
||||
other->outer_ids = outer_ids;
|
||||
|
||||
return other;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue