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:
Jon Siwek 2020-05-21 00:50:48 -07:00
parent 5af962e11f
commit 3b6f60a810
4 changed files with 10 additions and 3 deletions

View file

@ -84,7 +84,7 @@ IntrusivePtr<Func> zeek::id::find_func(std::string_view name)
reporter->InternalError("Expected variable '%s' to be a function",
std::string(name).data());
return {NewRef{}, v->AsFunc()};
return v->AsFuncPtr();
}
void zeek::id::detail::init()