mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +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
|
@ -211,6 +211,16 @@ TableConstInfo::TableConstInfo(CPPCompile* c, ValPtr v) : CompoundItemInfo(c, v)
|
|||
{
|
||||
auto tv = cast_intrusive<TableVal>(v);
|
||||
|
||||
auto gi = c->RegisterAttributes(tv->GetAttrs());
|
||||
int attrs = -1;
|
||||
if ( gi )
|
||||
{
|
||||
init_cohort = max(init_cohort, gi->InitCohort() + 1);
|
||||
attrs = gi->Offset();
|
||||
}
|
||||
|
||||
vals.emplace_back(std::to_string(attrs));
|
||||
|
||||
for ( auto& tv_i : tv->ToMap() )
|
||||
{
|
||||
vals.emplace_back(ValElem(c, tv_i.first)); // index
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue