Lambdas selectively clone from the closure.

This commit is contained in:
Zeke Medley 2019-06-21 12:02:41 -07:00
parent 63117de050
commit 8257a644d3
6 changed files with 62 additions and 39 deletions

View file

@ -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()