Merge branch 'master' into topic/vern/lambda-copy-semantics

This commit is contained in:
Jon Siwek 2021-01-11 11:48:45 -08:00
commit 614fade0a4
68 changed files with 21745 additions and 252 deletions

View file

@ -310,6 +310,7 @@ ScriptFunc::ScriptFunc(const IDPtr& arg_id, StmtPtr arg_body,
{
Body b;
b.stmts = AddInits(std::move(arg_body), aggr_inits);
current_body = b.stmts;
b.priority = priority;
bodies.push_back(b);
}
@ -387,8 +388,7 @@ ValPtr ScriptFunc::Invoke(zeek::Args* args, Frame* parent) const
for ( const auto& body : bodies )
{
if ( sample_logger )
sample_logger->LocationSeen(
body.stmts->GetLocationInfo());
sample_logger->LocationSeen(body.stmts->GetLocationInfo());
// Fill in the rest of the frame with the function's arguments.
for ( auto j = 0u; j < args->size(); ++j )
@ -550,6 +550,8 @@ void ScriptFunc::AddBody(StmtPtr new_body,
b.stmts = new_body;
b.priority = priority;
current_body = new_body;
bodies.push_back(b);
sort(bodies.begin(), bodies.end());
}
@ -701,6 +703,7 @@ BuiltinFunc::BuiltinFunc(built_in_func arg_func, const char* arg_name,
type = id->GetType<FuncType>();
id->SetVal(make_intrusive<Val>(IntrusivePtr{NewRef{}, this}));
id->SetConst();
}
BuiltinFunc::~BuiltinFunc()