mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
fix for -O gen-C++ dealing with type constants of unnamed compound types
This commit is contained in:
parent
224519c11a
commit
e165e64fa5
3 changed files with 8 additions and 11 deletions
|
@ -299,9 +299,12 @@ void FuncConstInfo::InitializerVals(std::vector<std::string>& ivs) const {
|
|||
}
|
||||
}
|
||||
|
||||
void TypeConstInfo::InitializerVals(std::vector<std::string>& ivs) const {
|
||||
auto& t = tv->GetType()->AsTypeType()->GetType();
|
||||
ivs.emplace_back(Fmt(t->Tag()));
|
||||
TypeConstInfo::TypeConstInfo(CPPCompile* _c, ValPtr v) : CompoundItemInfo(_c, v) {
|
||||
auto tv = v->AsTypeVal();
|
||||
auto t = tv->GetType()->AsTypeType()->GetType();
|
||||
auto gi = c->RegisterType(t);
|
||||
type = c->TypeOffset(t);
|
||||
init_cohort = max(init_cohort, gi->InitCohort() + 1);
|
||||
}
|
||||
|
||||
AttrInfo::AttrInfo(CPPCompile* _c, const AttrPtr& attr) : CompoundItemInfo(_c) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue