diff --git a/src/Expr.cc b/src/Expr.cc index 223c27da2a..3ff94d3242 100644 --- a/src/Expr.cc +++ b/src/Expr.cc @@ -233,7 +233,7 @@ IntrusivePtr NameExpr::Eval(Frame* f) const IntrusivePtr v; if ( id->IsType() ) - return make_intrusive(id->GetType().get(), true); + return make_intrusive(id->GetType(), true); if ( id->IsGlobal() ) v = {NewRef{}, id->ID_Val()}; diff --git a/src/Val.h b/src/Val.h index 455ae7b19c..eb81241c3a 100644 --- a/src/Val.h +++ b/src/Val.h @@ -137,8 +137,12 @@ public: explicit Val(BroFile* f); // Extra arg to differentiate from protected version. - Val(BroType* t, bool type_type) - : type(new TypeType({NewRef{}, t})) + Val(IntrusivePtr t, bool type_type) + : 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) { }