use dynamic rather than static initialization of globals for scripts compiled to C++

This commit is contained in:
Vern Paxson 2022-09-29 15:11:05 -07:00
parent 6ad28b37e6
commit 0687959f1c
5 changed files with 59 additions and 14 deletions

View file

@ -485,11 +485,10 @@ void CPP_GlobalInit::Generate(InitsManager* im, std::vector<void*>& /* inits_vec
global = lookup_global__CPP(name, im->Types(type), exported);
if ( ! global->HasVal() && val >= 0 )
{
global->SetVal(im->ConstVals(val));
if ( attrs >= 0 )
global->SetAttrs(im->Attributes(attrs));
}
if ( attrs >= 0 )
global->SetAttrs(im->Attributes(attrs));
}
void generate_indices_set(int* inits, std::vector<std::vector<int>>& indices_set)