mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix crash when printing type of recursive structures.
Also slightly fix indentation in Type.h
This commit is contained in:
parent
13c4489578
commit
c5a14d1bc1
6 changed files with 50 additions and 6 deletions
21
src/Desc.cc
21
src/Desc.cc
|
@ -351,3 +351,24 @@ void ODesc::Clear()
|
|||
}
|
||||
}
|
||||
|
||||
bool ODesc::PushType(const BroType* type)
|
||||
{
|
||||
auto res = encountered_types.insert(type);
|
||||
return std::get<1>(res);
|
||||
}
|
||||
|
||||
bool ODesc::PopType(const BroType* type)
|
||||
{
|
||||
size_t res = encountered_types.erase(type);
|
||||
return (res == 1);
|
||||
}
|
||||
|
||||
bool ODesc::FindType(const BroType* type)
|
||||
{
|
||||
auto res = encountered_types.find(type);
|
||||
|
||||
if ( res != encountered_types.end() )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue