fixes for initializations of "-O gen-C++" script compilations

This commit is contained in:
Vern Paxson 2024-01-10 18:35:09 -08:00 committed by Arne Welzel
parent bae87fb606
commit f7b739a47d
4 changed files with 14 additions and 3 deletions

View file

@ -441,7 +441,7 @@ TableTypeInfo::TableTypeInfo(CPPCompile* _c, TypePtr _t) : AbstractTypeInfo(_c,
auto gi = c->RegisterType(tbl->GetIndices());
ASSERT(gi);
indices = gi->Offset();
final_init_cohort = gi->InitCohort();
final_init_cohort = gi->InitCohort() + 1;
yield = tbl->Yield();

View file

@ -22,8 +22,10 @@ public:
CPPTableType() : TableType(nullptr, nullptr){};
void SetIndexAndYield(TypeListPtr ind, TypePtr yield) {
ind = std::move(indices);
indices = std::move(ind);
yield_type = std::move(yield);
SetSpecialIndices();
RegenerateHash();
}
};

View file

@ -221,7 +221,7 @@ TableValPtr set_constructor__CPP(vector<ValPtr> elements, TableTypePtr t, vector
auto aggr = make_intrusive<TableVal>(std::move(t), std::move(attrs));
for ( auto& elem : elements )
aggr->Assign(std::move(elem), nullptr);
aggr->Assign(elem, nullptr);
return aggr;
}