mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Add Val TypeType constructor taking an IntrusivePtr
This commit is contained in:
parent
3f07c57523
commit
4af1a26b1f
2 changed files with 7 additions and 3 deletions
|
@ -233,7 +233,7 @@ IntrusivePtr<Val> NameExpr::Eval(Frame* f) const
|
||||||
IntrusivePtr<Val> v;
|
IntrusivePtr<Val> v;
|
||||||
|
|
||||||
if ( id->IsType() )
|
if ( id->IsType() )
|
||||||
return make_intrusive<Val>(id->GetType().get(), true);
|
return make_intrusive<Val>(id->GetType(), true);
|
||||||
|
|
||||||
if ( id->IsGlobal() )
|
if ( id->IsGlobal() )
|
||||||
v = {NewRef{}, id->ID_Val()};
|
v = {NewRef{}, id->ID_Val()};
|
||||||
|
|
|
@ -137,8 +137,12 @@ public:
|
||||||
explicit Val(BroFile* f);
|
explicit Val(BroFile* f);
|
||||||
|
|
||||||
// Extra arg to differentiate from protected version.
|
// Extra arg to differentiate from protected version.
|
||||||
Val(BroType* t, bool type_type)
|
Val(IntrusivePtr<BroType> t, bool type_type)
|
||||||
: type(new TypeType({NewRef{}, t}))
|
: type(new TypeType(std::move(t)))
|
||||||
|
{ }
|
||||||
|
|
||||||
|
[[deprecated("Remove in v4.1. Construct from IntrusivePtr instead.")]]
|
||||||
|
Val(BroType* t, bool type_type) : Val({NewRef{}, t}, type_type)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue