mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 00:28:21 +00:00
Add Val::AsFuncPtr() convenience method
Since it's not trivial to store IntrusivePtr in BroValUnion and also not satisfying to store IntrusivePtr*.
This commit is contained in:
parent
5af962e11f
commit
3b6f60a810
4 changed files with 10 additions and 3 deletions
|
@ -153,6 +153,12 @@ IntrusivePtr<Val> Val::DoClone(CloneState* state)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
IntrusivePtr<Func> Val::AsFuncPtr() const
|
||||
{
|
||||
CHECK_TAG(type->Tag(), TYPE_FUNC, "Val::Func", type_name)
|
||||
return {NewRef{}, val.func_val};
|
||||
}
|
||||
|
||||
bool Val::IsZero() const
|
||||
{
|
||||
switch ( type->InternalType() ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue