Deprecate returning Val* from BIFs

This commit is contained in:
Jon Siwek 2020-04-20 15:20:42 -07:00
parent 6c0a9b0d8f
commit 80d3918b13
3 changed files with 8 additions and 0 deletions

2
NEWS
View file

@ -117,6 +117,8 @@ Deprecated Functionality
- ``binpac::string_to_val()`` is deprecated, use ``StringVal`` constructor. - ``binpac::string_to_val()`` is deprecated, use ``StringVal`` constructor.
- Returning ``Val*`` from BIFs is deprecated, return ``IntrusivePtr`` instead.
Zeek 3.1.0 Zeek 3.1.0
========== ==========

View file

@ -891,6 +891,9 @@ function_ingredients::~function_ingredients()
delete inits; delete inits;
} }
BifReturnVal::BifReturnVal(std::nullptr_t) noexcept
{ }
BifReturnVal::BifReturnVal(Val* v) noexcept BifReturnVal::BifReturnVal(Val* v) noexcept
: rval(AdoptRef{}, v) : rval(AdoptRef{}, v)
{ } { }

View file

@ -201,6 +201,9 @@ public:
: rval(AdoptRef{}, v.release()) : rval(AdoptRef{}, v.release())
{ } { }
BifReturnVal(std::nullptr_t) noexcept;
[[deprecated("Remove in v4.1. Return an IntrusivePtr instead.")]]
BifReturnVal(Val* v) noexcept; BifReturnVal(Val* v) noexcept;
private: private: