Remove variant from StdFunctionStmt

The variant ended up conflicting with std::bind, which resulted in failures
on the btest invoking it. Change back to a single function that takes a
flow, and default it to a value in Exec.
This commit is contained in:
Tim Wojtulewicz 2024-03-19 09:07:45 -07:00
parent 8bfe32e931
commit 9de1dd16d5
6 changed files with 14 additions and 17 deletions

View file

@ -129,7 +129,7 @@ void Func::AddBody(const detail::FunctionIngredients& ingr, detail::StmtPtr new_
void Func::AddBody(detail::StmtPtr new_body, const std::vector<detail::IDPtr>& new_inits, size_t new_frame_size,
int priority) {
std::set<EventGroupPtr> groups;
AddBody(new_body, new_inits, new_frame_size, priority, groups);
AddBody(std::move(new_body), new_inits, new_frame_size, priority, groups);
}
void Func::AddBody(detail::StmtPtr new_body, size_t new_frame_size) {
@ -143,7 +143,7 @@ void Func::AddBody(detail::StmtPtr /* new_body */, const std::vector<detail::IDP
Internal("Func::AddBody called");
}
void Func::AddBody(detail::StdFunctionStmt::FunctionVariant body, int priority) {
void Func::AddBody(std::function<void(const zeek::Args&, detail::StmtFlowType&)> body, int priority) {
auto stmt = zeek::make_intrusive<detail::StdFunctionStmt>(std::move(body));
AddBody(stmt, {}, priority);
}