mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
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:
parent
10f96aeba3
commit
a0540f96a1
4 changed files with 4 additions and 36 deletions
16
src/Type.cc
16
src/Type.cc
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue