mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
Change Scope/Func inits from id_list* to vector<IntrusivePtr<ID>>
This commit is contained in:
parent
46e23b49fb
commit
2cee468eac
8 changed files with 48 additions and 91 deletions
24
src/Func.cc
24
src/Func.cc
|
@ -121,8 +121,9 @@ Func::Func(Kind arg_kind) : kind(arg_kind)
|
|||
|
||||
Func::~Func() = default;
|
||||
|
||||
void Func::AddBody(IntrusivePtr<Stmt> /* new_body */, id_list* /* new_inits */,
|
||||
size_t /* new_frame_size */, int /* priority */)
|
||||
void Func::AddBody(IntrusivePtr<Stmt> /* new_body */,
|
||||
const std::vector<IntrusivePtr<ID>>& /* new_inits */,
|
||||
size_t /* new_frame_size */, int /* priority */)
|
||||
{
|
||||
Internal("Func::AddBody called");
|
||||
}
|
||||
|
@ -267,7 +268,8 @@ void Func::CheckPluginResult(bool handled, const IntrusivePtr<Val>& hook_result,
|
|||
}
|
||||
}
|
||||
|
||||
BroFunc::BroFunc(ID* arg_id, IntrusivePtr<Stmt> arg_body, id_list* aggr_inits,
|
||||
BroFunc::BroFunc(ID* arg_id, IntrusivePtr<Stmt> arg_body,
|
||||
const std::vector<IntrusivePtr<ID>>& aggr_inits,
|
||||
size_t arg_frame_size, int priority)
|
||||
: Func(BRO_FUNC)
|
||||
{
|
||||
|
@ -447,7 +449,8 @@ IntrusivePtr<Val> BroFunc::operator()(zeek::Args* args, Frame* parent) const
|
|||
return result;
|
||||
}
|
||||
|
||||
void BroFunc::AddBody(IntrusivePtr<Stmt> new_body, id_list* new_inits,
|
||||
void BroFunc::AddBody(IntrusivePtr<Stmt> new_body,
|
||||
const std::vector<IntrusivePtr<ID>>& new_inits,
|
||||
size_t new_frame_size, int priority)
|
||||
{
|
||||
if ( new_frame_size > frame_size )
|
||||
|
@ -571,9 +574,10 @@ void BroFunc::Describe(ODesc* d) const
|
|||
}
|
||||
}
|
||||
|
||||
IntrusivePtr<Stmt> BroFunc::AddInits(IntrusivePtr<Stmt> body, id_list* inits)
|
||||
IntrusivePtr<Stmt> BroFunc::AddInits(IntrusivePtr<Stmt> body,
|
||||
const std::vector<IntrusivePtr<ID>>& inits)
|
||||
{
|
||||
if ( ! inits || inits->length() == 0 )
|
||||
if ( inits.empty() )
|
||||
return body;
|
||||
|
||||
auto stmt_series = make_intrusive<StmtList>();
|
||||
|
@ -889,14 +893,6 @@ function_ingredients::function_ingredients(IntrusivePtr<Scope> scope, IntrusiveP
|
|||
this->body = std::move(body);
|
||||
}
|
||||
|
||||
function_ingredients::~function_ingredients()
|
||||
{
|
||||
for ( const auto& i : *inits )
|
||||
Unref(i);
|
||||
|
||||
delete inits;
|
||||
}
|
||||
|
||||
BifReturnVal::BifReturnVal(std::nullptr_t) noexcept
|
||||
{ }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue