Switch Frame::SetElement() to use IntrusivePtr

This commit is contained in:
Jon Siwek 2020-05-23 00:47:52 -07:00
parent 1c617c4f7a
commit e9e2e388f8
5 changed files with 78 additions and 60 deletions

View file

@ -365,11 +365,11 @@ IntrusivePtr<Val> BroFunc::operator()(zeek::Args* args, Frame* parent) const
// Fill in the rest of the frame with the function's arguments.
for ( auto j = 0u; j < args->size(); ++j )
{
Val* arg = (*args)[j].get();
const auto& arg = (*args)[j];
if ( f->NthElement(j) != arg )
// Either not yet set, or somebody reassigned the frame slot.
f->SetElement(j, arg->Ref());
f->SetElement(j, arg);
}
f->Reset(args->size());