mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
Change BIFs to return a wrapper object
That allows returning either Val* or IntrusivePtr<T>. The former could eventually be deprecated, but it's used extensively at the moment.
This commit is contained in:
parent
8843f69002
commit
eb77411dbf
3 changed files with 29 additions and 3 deletions
|
@ -633,7 +633,7 @@ IntrusivePtr<Val> BuiltinFunc::Call(const zeek::Args& args, Frame* parent) const
|
|||
|
||||
const CallExpr* call_expr = parent ? parent->GetCall() : nullptr;
|
||||
call_stack.emplace_back(CallInfo{call_expr, this, args});
|
||||
IntrusivePtr<Val> result{AdoptRef{}, func(parent, &args)};
|
||||
auto result = std::move(func(parent, &args).rval);
|
||||
call_stack.pop_back();
|
||||
|
||||
if ( result && g_trace_state.DoTrace() )
|
||||
|
@ -890,3 +890,7 @@ function_ingredients::~function_ingredients()
|
|||
|
||||
delete inits;
|
||||
}
|
||||
|
||||
BifReturnVal::BifReturnVal(Val* v) noexcept
|
||||
: rval(AdoptRef{}, v)
|
||||
{ }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue