Revert "Type: Add TypeManager->TypeList() and use for ListVal()"

This reverts commit 24c606b4df.

This commit introduced a memory leak ListVal::Append() modifying
the cached TYPE_ANY type list.
This commit is contained in:
Arne Welzel 2023-04-13 16:55:11 +02:00
parent 10f96aeba3
commit a0540f96a1
4 changed files with 4 additions and 36 deletions

View file

@ -1981,22 +1981,6 @@ detail::TraversalCode VectorType::Traverse(detail::TraversalCallback* cb) const
HANDLE_TC_TYPE_POST(tc);
}
TypeManager::TypeManager()
{
for ( auto i = 0u; i < base_list_types.size(); ++i )
{
TypeTag tag = static_cast<TypeTag>(i);
TypePtr pure_type = tag == TYPE_ANY ? nullptr : base_type(tag);
base_list_types[tag] = make_intrusive<zeek::TypeList>(pure_type);
}
}
const TypeListPtr& TypeManager::TypeList(TypeTag t) const
{
assert(t >= 0 && t < NUM_TYPES);
return base_list_types[t];
}
// Returns true if t1 is initialization-compatible with t2 (i.e., if an
// initializer with type t1 can be used to initialize a value with type t2),
// false otherwise. Assumes that t1's tag is different from t2's. Note