From e1338cc379b02a75ca367fc8e208c44ae112d2c5 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Sat, 27 Jun 2020 10:41:35 -0700 Subject: [PATCH] GH-1034: Revert TypeList::Types() back to return a type_list* and mark it deprecated --- NEWS | 3 --- src/Attr.cc | 10 ++++----- src/CompHash.cc | 14 ++++++------ src/Expr.cc | 14 ++++++------ src/RuleCondition.cc | 2 +- src/Stmt.cc | 2 +- src/Type.cc | 46 ++++++++++++++++++++-------------------- src/Type.h | 22 +++++++++++++++---- src/Val.cc | 12 +++++------ src/broker/Data.cc | 8 +++---- src/broker/Manager.cc | 4 ++-- src/broker/messaging.bif | 2 +- src/input/Manager.cc | 8 +++---- src/logging/Manager.cc | 2 +- src/option.bif | 4 ++-- 15 files changed, 82 insertions(+), 71 deletions(-) diff --git a/NEWS b/NEWS index b8223c4749..a8261084ce 100644 --- a/NEWS +++ b/NEWS @@ -100,9 +100,6 @@ Changed Functionality - The DCE/RPC operation string of "NetrLogonSamLogonWithFlags" has been corrected from "NetrLogonSameLogonWithFlags". -- ``TypeList::Types()`` and ``IndexType::IndexTypes()`` now return an - ``std::vector`` instead of ``type_list*`` - - ``AsRecord()`` and ``AsNonConstRecord()`` have changed to return ``std::vector>*``. diff --git a/src/Attr.cc b/src/Attr.cc index 859ddaa720..bd722e68c2 100644 --- a/src/Attr.cc +++ b/src/Attr.cc @@ -394,7 +394,7 @@ void Attributes::CheckAttr(Attr* a) if ( atype->Tag() == TYPE_FUNC ) { FuncType* f = atype->AsFuncType(); - if ( ! f->CheckArgs(tt->IndexTypes()) || + if ( ! f->CheckArgs(tt->GetIndexTypes()) || ! same_type(f->Yield(), ytype) ) Error("&default function type clash"); @@ -517,7 +517,7 @@ void Attributes::CheckAttr(Attr* a) if (the_table->IsUnspecifiedTable()) break; - const auto& func_index_types = e_ft->ParamList()->Types(); + const auto& func_index_types = e_ft->ParamList()->GetTypes(); // Keep backwards compatibility with idx: any idiom. if ( func_index_types.size() == 2 ) { @@ -525,7 +525,7 @@ void Attributes::CheckAttr(Attr* a) break; } - const auto& table_index_types = the_table->IndexTypes(); + const auto& table_index_types = the_table->GetIndexTypes(); type_list expected_args(1 + static_cast(table_index_types.size())); expected_args.push_back(type->AsTableType()); @@ -564,8 +564,8 @@ void Attributes::CheckAttr(Attr* a) if ( the_table->IsUnspecifiedTable() ) break; - const auto& args = c_ft->ParamList()->Types(); - const auto& t_indexes = the_table->IndexTypes(); + const auto& args = c_ft->ParamList()->GetTypes(); + const auto& t_indexes = the_table->GetIndexTypes(); if ( args.size() != ( type->IsSet() ? 2 : 3 ) + t_indexes.size() ) { Error("&on_change function has incorrect number of arguments"); diff --git a/src/CompHash.cc b/src/CompHash.cc index 4e3f56b19e..0b08aafb5b 100644 --- a/src/CompHash.cc +++ b/src/CompHash.cc @@ -23,9 +23,9 @@ CompositeHash::CompositeHash(IntrusivePtr composite_type) // If the only element is a record, don't treat it as a // singleton, since it needs to be evaluated specially. - if ( type->Types().size() == 1 ) + if ( type->GetTypes().size() == 1 ) { - if ( type->Types()[0]->Tag() == zeek::TYPE_RECORD ) + if ( type->GetTypes()[0]->Tag() == zeek::TYPE_RECORD ) { is_complex_type = true; is_singleton = false; @@ -47,7 +47,7 @@ CompositeHash::CompositeHash(IntrusivePtr composite_type) { // Don't do any further key computations - we'll do them // via the singleton later. - singleton_tag = type->Types()[0]->InternalType(); + singleton_tag = type->GetTypes()[0]->InternalType(); size = 0; key = nullptr; } @@ -367,7 +367,7 @@ std::unique_ptr CompositeHash::MakeHashKey(const Val& argv, bool type_c type_check = false; // no need to type-check again. } - const auto& tl = type->Types(); + const auto& tl = type->GetTypes(); if ( type_check && v->GetType()->Tag() != zeek::TYPE_LIST ) return nullptr; @@ -625,7 +625,7 @@ int CompositeHash::SingleTypeKeySize(zeek::Type* bt, const Val* v, int CompositeHash::ComputeKeySize(const Val* v, bool type_check, bool calc_static_size) const { - const auto& tl = type->Types(); + const auto& tl = type->GetTypes(); if ( v ) { @@ -712,7 +712,7 @@ int CompositeHash::SizeAlign(int offset, unsigned int size) const IntrusivePtr CompositeHash::RecoverVals(const HashKey& k) const { auto l = make_intrusive(zeek::TYPE_ANY); - const auto& tl = type->Types(); + const auto& tl = type->GetTypes(); const char* kp = (const char*) k.Key(); const char* const k_end = kp + k.Size(); @@ -1011,7 +1011,7 @@ const char* CompositeHash::RecoverOneVal(const HashKey& k, const char* kp0, for ( int i = 0; i < n; ++i ) { IntrusivePtr v; - zeek::Type* it = tl->Types()[i].get(); + zeek::Type* it = tl->GetTypes()[i].get(); kp1 = RecoverOneVal(k, kp1, k_end, it, &v, false); lv->Append(std::move(v)); } diff --git a/src/Expr.cc b/src/Expr.cc index 8f32196452..4cbbc4520b 100644 --- a/src/Expr.cc +++ b/src/Expr.cc @@ -3086,7 +3086,7 @@ TableConstructorExpr::TableConstructorExpr(IntrusivePtr constructor_li if ( arg_attrs ) attrs = make_intrusive(std::move(*arg_attrs), type, false, false); - const auto& indices = type->AsTableType()->GetIndices()->Types(); + const auto& indices = type->AsTableType()->GetIndices()->GetTypes(); const expr_list& cle = op->AsListExpr()->Exprs(); // check and promote all index expressions in ctor list @@ -3204,7 +3204,7 @@ SetConstructorExpr::SetConstructorExpr(IntrusivePtr constructor_list, if ( arg_attrs ) attrs = make_intrusive(std::move(*arg_attrs), type, false, false); - const auto& indices = type->AsTableType()->GetIndices()->Types(); + const auto& indices = type->AsTableType()->GetIndices()->GetTypes(); expr_list& cle = op->AsListExpr()->Exprs(); if ( indices.size() == 1 ) @@ -4471,7 +4471,7 @@ IntrusivePtr ListExpr::InitVal(const zeek::Type* t, IntrusivePtr aggr) if ( ! aggr && type->AsTypeList()->AllMatch(t, true) ) { auto v = make_intrusive(zeek::TYPE_ANY); - const auto& tl = type->AsTypeList()->Types(); + const auto& tl = type->AsTypeList()->GetTypes(); if ( exprs.length() != static_cast(tl.size()) ) { @@ -4499,7 +4499,7 @@ IntrusivePtr ListExpr::InitVal(const zeek::Type* t, IntrusivePtr aggr) return nullptr; } - const auto& tl = t->AsTypeList()->Types(); + const auto& tl = t->AsTypeList()->GetTypes(); if ( exprs.length() != static_cast(tl.size()) ) { @@ -4620,7 +4620,7 @@ IntrusivePtr ListExpr::AddSetInit(const zeek::Type* t, IntrusivePtr ag else if ( expr->GetType()->Tag() == zeek::TYPE_LIST ) element = expr->InitVal(it, nullptr); else - element = expr->InitVal(it->Types()[0].get(), nullptr); + element = expr->InitVal(it->GetTypes()[0].get(), nullptr); if ( ! element ) return nullptr; @@ -4642,7 +4642,7 @@ IntrusivePtr ListExpr::AddSetInit(const zeek::Type* t, IntrusivePtr ag if ( expr->GetType()->Tag() == zeek::TYPE_LIST ) element = check_and_promote(std::move(element), it, true); else - element = check_and_promote(std::move(element), it->Types()[0].get(), true); + element = check_and_promote(std::move(element), it->GetTypes()[0].get(), true); if ( ! element ) return nullptr; @@ -4930,7 +4930,7 @@ IntrusivePtr check_and_promote_expr(Expr* const e, zeek::Type* t) bool check_and_promote_exprs(ListExpr* const elements, TypeList* types) { expr_list& el = elements->Exprs(); - const auto& tl = types->Types(); + const auto& tl = types->GetTypes(); if ( tl.size() == 1 && tl[0]->Tag() == zeek::TYPE_ANY ) return true; diff --git a/src/RuleCondition.cc b/src/RuleCondition.cc index 8277e7952d..2735a876b0 100644 --- a/src/RuleCondition.cc +++ b/src/RuleCondition.cc @@ -149,7 +149,7 @@ RuleConditionEval::RuleConditionEval(const char* func) tl.Append(signature_state); tl.Append(zeek::base_type(zeek::TYPE_STRING)); - if ( ! f->CheckArgs(tl.Types()) ) + if ( ! f->CheckArgs(tl.GetTypes()) ) rules_error("eval function parameters must be a 'signature_state' " "and a 'string' type", func); } diff --git a/src/Stmt.cc b/src/Stmt.cc index 00fab5776c..a7919e52b2 100644 --- a/src/Stmt.cc +++ b/src/Stmt.cc @@ -1067,7 +1067,7 @@ ForStmt::ForStmt(id_list* arg_loop_vars, IntrusivePtr loop_expr) if ( e->GetType()->Tag() == TYPE_TABLE ) { - const auto& indices = e->GetType()->AsTableType()->IndexTypes(); + const auto& indices = e->GetType()->AsTableType()->GetIndexTypes(); if ( static_cast(indices.size()) != loop_vars->length() ) { diff --git a/src/Type.cc b/src/Type.cc index 4c5e1ad45c..698d80c64e 100644 --- a/src/Type.cc +++ b/src/Type.cc @@ -168,6 +168,7 @@ void TypeList::Append(IntrusivePtr t) if ( pure_type && ! same_type(t, pure_type) ) reporter->InternalError("pure type-list violation"); + types_list.push_back(t.get()); types.emplace_back(std::move(t)); } @@ -176,6 +177,7 @@ void TypeList::AppendEvenIfNotPure(IntrusivePtr t) if ( pure_type && ! same_type(t, pure_type) ) pure_type = nullptr; + types_list.push_back(t.get()); types.emplace_back(std::move(t)); } @@ -220,12 +222,10 @@ unsigned int TypeList::MemoryAllocation() const + size; } -IndexType::~IndexType() = default; - int IndexType::MatchesIndex(zeek::detail::ListExpr* const index) const { // If we have a type indexed by subnets, addresses are ok. - const auto& types = indices->Types(); + const auto& types = indices->GetTypes(); const expr_list& exprs = index->Exprs(); if ( types.size() == 1 && types[0]->Tag() == TYPE_SUBNET && @@ -242,7 +242,7 @@ void IndexType::Describe(ODesc* d) const if ( ! d->IsBinary() ) d->Add("["); - const auto& its = IndexTypes(); + const auto& its = GetIndexTypes(); for ( auto i = 0u; i < its.size(); ++i ) { @@ -273,7 +273,7 @@ void IndexType::DescribeReST(ODesc* d, bool roles_only) const d->Add("` "); d->Add("["); - const auto& its = IndexTypes(); + const auto& its = GetIndexTypes(); for ( auto i = 0u; i < its.size(); ++i ) { @@ -311,7 +311,7 @@ void IndexType::DescribeReST(ODesc* d, bool roles_only) const bool IndexType::IsSubNetIndex() const { - const auto& types = indices->Types(); + const auto& types = indices->GetTypes(); if ( types.size() == 1 && types[0]->Tag() == TYPE_SUBNET ) return true; return false; @@ -323,7 +323,7 @@ TableType::TableType(IntrusivePtr ind, IntrusivePtr yield) if ( ! indices ) return; - const auto& tl = indices->Types(); + const auto& tl = indices->GetTypes(); for ( const auto& tli : tl ) { @@ -352,7 +352,7 @@ IntrusivePtr TableType::ShallowClone() bool TableType::IsUnspecifiedTable() const { // Unspecified types have an empty list of indices. - return indices->Types().empty(); + return indices->GetTypes().empty(); } SetType::SetType(IntrusivePtr ind, IntrusivePtr arg_elements) @@ -368,7 +368,7 @@ SetType::SetType(IntrusivePtr ind, IntrusivePtrGetType()->AsTypeList(); - const auto& tl = tl_type->Types(); + const auto& tl = tl_type->GetTypes(); if ( tl.size() < 1 ) { @@ -493,7 +493,7 @@ bool FuncType::CheckArgs(const type_list* args, bool is_init) const bool FuncType::CheckArgs(const std::vector>& args, bool is_init) const { - const auto& my_args = arg_types->Types(); + const auto& my_args = arg_types->GetTypes(); if ( my_args.size() != args.size() ) { @@ -774,7 +774,7 @@ static string container_type_name(const Type* ft) else s = "table["; - const auto& tl = ((const IndexType*) ft)->IndexTypes(); + const auto& tl = ((const IndexType*) ft)->GetIndexTypes(); for ( auto i = 0u; i < tl.size(); ++i ) { @@ -1481,7 +1481,7 @@ bool same_type(const Type& arg_t1, const Type& arg_t2, return false; } - return ft1->CheckArgs(ft2->ParamList()->Types(), is_init); + return ft1->CheckArgs(ft2->ParamList()->GetTypes(), is_init); } case TYPE_RECORD: @@ -1507,8 +1507,8 @@ bool same_type(const Type& arg_t1, const Type& arg_t2, case TYPE_LIST: { - const auto& tl1 = t1->AsTypeList()->Types(); - const auto& tl2 = t2->AsTypeList()->Types(); + const auto& tl1 = t1->AsTypeList()->GetTypes(); + const auto& tl2 = t2->AsTypeList()->GetTypes(); if ( tl1.size() != tl2.size() ) return false; @@ -1597,7 +1597,7 @@ const Type* flatten_type(const Type* t) if ( tl->IsPure() ) return tl->GetPureType().get(); - const auto& types = tl->Types(); + const auto& types = tl->GetTypes(); if ( types.size() == 0 ) reporter->InternalError("empty type list in flatten_type"); @@ -1756,8 +1756,8 @@ IntrusivePtr merge_types(const IntrusivePtr& arg_t1, const IndexType* it1 = (const IndexType*) t1; const IndexType* it2 = (const IndexType*) t2; - const auto& tl1 = it1->IndexTypes(); - const auto& tl2 = it2->IndexTypes(); + const auto& tl1 = it1->GetIndexTypes(); + const auto& tl2 = it2->GetIndexTypes(); IntrusivePtr tl3; if ( tl1.size() != tl2.size() ) @@ -1859,8 +1859,8 @@ IntrusivePtr merge_types(const IntrusivePtr& arg_t1, return nullptr; } - const auto& l1 = tl1->Types(); - const auto& l2 = tl2->Types(); + const auto& l1 = tl1->GetTypes(); + const auto& l2 = tl2->GetTypes(); if ( l1.size() == 0 || l2.size() == 0 ) { @@ -1927,7 +1927,7 @@ IntrusivePtr merge_types(const IntrusivePtr& arg_t1, IntrusivePtr merge_type_list(zeek::detail::ListExpr* elements) { TypeList* tl_type = elements->GetType()->AsTypeList(); - const auto& tl = tl_type->Types(); + const auto& tl = tl_type->GetTypes(); if ( tl.size() < 1 ) { @@ -1959,8 +1959,8 @@ static Type* reduce_type(Type* t) { const auto& tl = t->AsTableType()->GetIndices(); - if ( tl->Types().size() == 1 ) - return tl->Types()[0].get(); + if ( tl->GetTypes().size() == 1 ) + return tl->GetTypes()[0].get(); else return tl.get(); } @@ -1979,7 +1979,7 @@ IntrusivePtr init_type(zeek::detail::Expr* init) return nullptr; if ( t->Tag() == TYPE_LIST && - t->AsTypeList()->Types().size() != 1 ) + t->AsTypeList()->GetTypes().size() != 1 ) { init->Error("list used in scalar initialization"); return nullptr; diff --git a/src/Type.h b/src/Type.h index c123eb397c..97c09b81e5 100644 --- a/src/Type.h +++ b/src/Type.h @@ -416,7 +416,13 @@ public: { } - const std::vector>& Types() const + ~TypeList() override = default; + + [[deprecated("Remove in v4.1. Use GetTypes() instead.")]] + const type_list* Types() const + { return &types_list; } + + const std::vector>& GetTypes() const { return types; } bool IsPure() const { return pure_type != nullptr; } @@ -448,21 +454,29 @@ public: protected: IntrusivePtr pure_type; std::vector> types; + + // Remove in v4.1. This is used by Types(), which is deprecated. + type_list types_list; }; class IndexType : public Type { public: + int MatchesIndex(zeek::detail::ListExpr* index) const override; const IntrusivePtr& GetIndices() const { return indices; } - [[deprecated("Remove in v4.1. Use GetIndices().")]] + [[deprecated("Remove in v4.1. Use GetIndices().")]] TypeList* Indices() const { return indices.get(); } - const std::vector>& IndexTypes() const + [[deprecated("Remove in v4.1. Use GetIndexTypes().")]] + const type_list* IndexTypes() const { return indices->Types(); } + const std::vector>& GetIndexTypes() const + { return indices->GetTypes(); } + const IntrusivePtr& Yield() const override { return yield_type; } @@ -480,7 +494,7 @@ protected: { } - ~IndexType() override; + ~IndexType() override = default; IntrusivePtr indices; IntrusivePtr yield_type; diff --git a/src/Val.cc b/src/Val.cc index 7d0fbe610f..559a5027d3 100644 --- a/src/Val.cc +++ b/src/Val.cc @@ -275,7 +275,7 @@ IntrusivePtr Val::SizeVal() const case zeek::TYPE_INTERNAL_OTHER: if ( type->Tag() == zeek::TYPE_FUNC ) - return val_mgr->Count(val.func_val->GetType()->ParamList()->Types().size()); + return val_mgr->Count(val.func_val->GetType()->ParamList()->GetTypes().size()); if ( type->Tag() == zeek::TYPE_FILE ) return make_intrusive(val.file_val->Size()); @@ -1357,7 +1357,7 @@ static void find_nested_record_types(const IntrusivePtr& t, std::set return; case zeek::TYPE_LIST: { - for ( const auto& type : t->AsTypeList()->Types() ) + for ( const auto& type : t->AsTypeList()->GetTypes() ) find_nested_record_types(type, found); } return; @@ -1384,7 +1384,7 @@ TableVal::TableVal(IntrusivePtr t, IntrusivePtrIndexTypes() ) + for ( const auto& t : table_type->GetIndexTypes() ) { std::set found; // TODO: this likely doesn't have to be repeated for each new TableVal, @@ -1770,7 +1770,7 @@ bool TableVal::ExpandAndInit(IntrusivePtr index, IntrusivePtr new_val) ListVal* iv = index->AsListVal(); if ( iv->BaseTag() != zeek::TYPE_ANY ) { - if ( table_type->GetIndices()->Types().size() != 1 ) + if ( table_type->GetIndices()->GetTypes().size() != 1 ) reporter->InternalError("bad singleton list index"); for ( int i = 0; i < iv->Length(); ++i ) @@ -2179,7 +2179,7 @@ ListVal* TableVal::ConvertToList(zeek::TypeTag t) const IntrusivePtr TableVal::ToPureListVal() const { - const auto& tl = table_type->GetIndices()->Types(); + const auto& tl = table_type->GetIndices()->GetTypes(); if ( tl.size() != 1 ) { InternalWarning("bad index type in TableVal::ToPureListVal"); @@ -2515,7 +2515,7 @@ double TableVal::CallExpireFunc(IntrusivePtr idx) const Func* f = vf->AsFunc(); zeek::Args vl; - const auto& func_args = f->GetType()->ParamList()->Types(); + const auto& func_args = f->GetType()->ParamList()->GetTypes(); // backwards compatibility with idx: any idiom bool any_idiom = func_args.size() == 2 && func_args.back()->Tag() == zeek::TYPE_ANY; diff --git a/src/broker/Data.cc b/src/broker/Data.cc index 33413c74f0..0b1f6006c4 100644 --- a/src/broker/Data.cc +++ b/src/broker/Data.cc @@ -208,7 +208,7 @@ struct val_converter { for ( auto& item : a ) { - const auto& expected_index_types = tt->GetIndices()->Types(); + const auto& expected_index_types = tt->GetIndices()->GetTypes(); broker::vector composite_key; auto indices = caf::get_if(&item); @@ -267,7 +267,7 @@ struct val_converter { for ( auto& item : a ) { - const auto& expected_index_types = tt->GetIndices()->Types(); + const auto& expected_index_types = tt->GetIndices()->GetTypes(); broker::vector composite_key; auto indices = caf::get_if(&item.first); @@ -555,7 +555,7 @@ struct type_checker { for ( const auto& item : a ) { - const auto& expected_index_types = tt->GetIndices()->Types(); + const auto& expected_index_types = tt->GetIndices()->GetTypes(); auto indices = caf::get_if(&item); vector indices_to_check; @@ -614,7 +614,7 @@ struct type_checker { for ( auto& item : a ) { - const auto& expected_index_types = tt->GetIndices()->Types(); + const auto& expected_index_types = tt->GetIndices()->GetTypes(); auto indices = caf::get_if(&item.first); vector indices_to_check; diff --git a/src/broker/Manager.cc b/src/broker/Manager.cc index 0b93592d42..36631f13a2 100644 --- a/src/broker/Manager.cc +++ b/src/broker/Manager.cc @@ -742,7 +742,7 @@ RecordVal* Manager::MakeEvent(val_list* args, Frame* frame) } const auto& got_type = (*args)[i]->GetType(); - const auto& expected_type = func->GetType()->ParamList()->Types()[i - 1]; + const auto& expected_type = func->GetType()->ParamList()->GetTypes()[i - 1]; if ( ! same_type(got_type, expected_type) ) { @@ -978,7 +978,7 @@ void Manager::ProcessEvent(const broker::topic& topic, broker::zeek::Event ev) return; } - const auto& arg_types = handler->GetType(false)->ParamList()->Types(); + const auto& arg_types = handler->GetType(false)->ParamList()->GetTypes(); if ( arg_types.size() != args.size() ) { diff --git a/src/broker/messaging.bif b/src/broker/messaging.bif index f135388d88..0bfa56796e 100644 --- a/src/broker/messaging.bif +++ b/src/broker/messaging.bif @@ -12,7 +12,7 @@ static bool is_string_set(const zeek::Type* type) if ( ! type->IsSet() ) return false; - const auto& index_types = type->AsSetType()->IndexTypes(); + const auto& index_types = type->AsSetType()->GetIndexTypes(); if ( index_types.size() != 1 ) return false; diff --git a/src/input/Manager.cc b/src/input/Manager.cc index 1664b54f09..f4fa7ea7e5 100644 --- a/src/input/Manager.cc +++ b/src/input/Manager.cc @@ -332,7 +332,7 @@ bool Manager::CreateEventStream(RecordVal* fval) return false; } - const auto& args = etype->ParamList()->Types(); + const auto& args = etype->ParamList()->GetTypes(); if ( args.size() < 2 ) { @@ -482,7 +482,7 @@ bool Manager::CreateTableStream(RecordVal* fval) // check if index fields match table description size_t num = idx->NumFields(); - const auto& tl = dst->GetType()->AsTableType()->IndexTypes(); + const auto& tl = dst->GetType()->AsTableType()->GetIndexTypes(); size_t j; for ( j = 0; j < tl.size(); ++j ) @@ -557,7 +557,7 @@ bool Manager::CreateTableStream(RecordVal* fval) return false; } - const auto& args = etype->ParamList()->Types(); + const auto& args = etype->ParamList()->GetTypes(); if ( args.size() != 4 ) { @@ -704,7 +704,7 @@ bool Manager::CheckErrorEventTypes(const std::string& stream_name, const Func* e return false; } - const auto& args = etype->ParamList()->Types(); + const auto& args = etype->ParamList()->GetTypes(); if ( args.size() != 3 ) { diff --git a/src/logging/Manager.cc b/src/logging/Manager.cc index 1547c5bd55..cff56c63d0 100644 --- a/src/logging/Manager.cc +++ b/src/logging/Manager.cc @@ -277,7 +277,7 @@ bool Manager::CreateStream(EnumVal* id, RecordVal* sval) return false; } - const auto& args = etype->ParamList()->Types(); + const auto& args = etype->ParamList()->GetTypes(); if ( args.size() != 1 ) { diff --git a/src/option.bif b/src/option.bif index d55f3600c0..8d5daa9878 100644 --- a/src/option.bif +++ b/src/option.bif @@ -15,7 +15,7 @@ static bool call_option_handlers_and_set_value(StringVal* name, const IntrusiveP { for ( auto handler_function : i->GetOptionHandlers() ) { - bool add_loc = handler_function->GetType()->ParamList()->Types().size() == 3; + bool add_loc = handler_function->GetType()->ParamList()->GetTypes().size() == 3; zeek::Args vl; vl.reserve(2 + add_loc); vl.emplace_back(NewRef{}, name); @@ -170,7 +170,7 @@ function Option::set_change_handler%(ID: string, on_change: any, priority: int & return val_mgr->False(); } - const auto& args = on_change->GetType()->AsFuncType()->ParamList()->Types(); + const auto& args = on_change->GetType()->AsFuncType()->ParamList()->GetTypes(); if ( args.size() < 2 || args.size() > 3 ) { builtin_error(fmt("Wrong number of arguments for passed function in Option::on_change for ID '%s'; expected 2 or 3, got %zu",