-O gen-C++ maintenance: fixes for attributes & initializing globals

This commit is contained in:
Vern Paxson 2022-10-14 08:37:45 -05:00
parent 6fcbb55ccd
commit 26dae9a5ae
9 changed files with 54 additions and 12 deletions

View file

@ -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();
}