mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00
use dynamic rather than static initialization of globals for scripts compiled to C++
This commit is contained in:
parent
6ad28b37e6
commit
0687959f1c
5 changed files with 59 additions and 14 deletions
|
@ -339,16 +339,7 @@ GlobalInitInfo::GlobalInitInfo(CPPCompile* c, const ID* g, string _CPP_name)
|
|||
attrs = -1;
|
||||
|
||||
exported = g->IsExport();
|
||||
|
||||
auto v = g->GetVal();
|
||||
if ( v && gt->Tag() == TYPE_OPAQUE )
|
||||
{
|
||||
reporter->Error("cannot compile to C++ global \"%s\" initialized to opaque value",
|
||||
g->Name());
|
||||
v = nullptr;
|
||||
}
|
||||
|
||||
val = ValElem(c, v);
|
||||
val = ValElem(c, nullptr); // empty because we initialize dynamically
|
||||
}
|
||||
|
||||
void GlobalInitInfo::InitializerVals(std::vector<std::string>& ivs) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue