mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
Lambdas selectively clone from the closure.
This commit is contained in:
parent
63117de050
commit
8257a644d3
6 changed files with 62 additions and 39 deletions
18
src/Func.cc
18
src/Func.cc
|
@ -488,23 +488,7 @@ void BroFunc::SetClosureFrame(Frame* f)
|
|||
reporter->InternalError
|
||||
("Tried to override closure for BroFunc %s.", this->Name());
|
||||
|
||||
this->closure = f ? f->Clone() : nullptr;
|
||||
}
|
||||
|
||||
void BroFunc::ShiftOffsets(int shift, std::shared_ptr<id_list> idl)
|
||||
{
|
||||
id_list* tmp = idl.get();
|
||||
if (! idl || shift == 0)
|
||||
{
|
||||
// Nothing to do here.
|
||||
return;
|
||||
}
|
||||
|
||||
loop_over_list(*tmp, i)
|
||||
{
|
||||
ID* id = (*tmp)[i];
|
||||
id->SetOffset(id->Offset() + shift);
|
||||
}
|
||||
this->closure = f ? f->SelectiveClone(this->outer_ids.get()) : nullptr;
|
||||
}
|
||||
|
||||
Val* BroFunc::DoClone()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue