mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 15:18:20 +00:00
-O gen-C++ maintenance: fixes for attributes & initializing globals
This commit is contained in:
parent
6fcbb55ccd
commit
26dae9a5ae
9 changed files with 54 additions and 12 deletions
|
@ -48,6 +48,16 @@ shared_ptr<CPP_InitInfo> CPPCompile::RegisterConstant(const ValPtr& vp, int& con
|
|||
// render the same.
|
||||
t->Describe(&d);
|
||||
|
||||
// Likewise, tables that have attributes.
|
||||
if ( t->Tag() == TYPE_TABLE )
|
||||
{
|
||||
const auto& attrs = v->AsTableVal()->GetAttrs();
|
||||
if ( attrs )
|
||||
attrs->Describe(&d);
|
||||
else
|
||||
d.Add("<no-attrs>");
|
||||
}
|
||||
|
||||
c_desc = d.Description();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue