mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 21:48:21 +00:00
Type: use class IntrusivePtr in IndexType
This commit is contained in:
parent
674e141a15
commit
de0289125b
8 changed files with 45 additions and 77 deletions
|
@ -2300,7 +2300,7 @@ IntrusivePtr<BroType> AssignExpr::InitType() const
|
|||
if ( tl->Tag() != TYPE_LIST )
|
||||
Internal("inconsistent list expr in AssignExpr::InitType");
|
||||
|
||||
return make_intrusive<TableType>(tl->Ref()->AsTypeList(), op2->Type()->Ref());
|
||||
return make_intrusive<TableType>(IntrusivePtr{NewRef{}, tl->AsTypeList()}, IntrusivePtr{NewRef{}, op2->Type()});
|
||||
}
|
||||
|
||||
void AssignExpr::EvalIntoAggregate(const BroType* t, Val* aggr, Frame* f) const
|
||||
|
@ -3109,7 +3109,7 @@ TableConstructorExpr::TableConstructorExpr(IntrusivePtr<ListExpr> constructor_li
|
|||
else
|
||||
{
|
||||
if ( op->AsListExpr()->Exprs().empty() )
|
||||
SetType(make_intrusive<TableType>(new TypeList(base_type(TYPE_ANY)), nullptr));
|
||||
SetType(make_intrusive<TableType>(make_intrusive<TypeList>(base_type(TYPE_ANY)), nullptr));
|
||||
else
|
||||
{
|
||||
SetType({AdoptRef{}, init_type(op.get())});
|
||||
|
@ -3223,7 +3223,7 @@ SetConstructorExpr::SetConstructorExpr(IntrusivePtr<ListExpr> constructor_list,
|
|||
else
|
||||
{
|
||||
if ( op->AsListExpr()->Exprs().empty() )
|
||||
SetType(make_intrusive<::SetType>(new TypeList(base_type(TYPE_ANY)), nullptr));
|
||||
SetType(make_intrusive<::SetType>(make_intrusive<TypeList>(base_type(TYPE_ANY)), nullptr));
|
||||
else
|
||||
SetType({AdoptRef{}, init_type(op.get())});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue