fixes for ?$ operator - always track it, and assume subrecords are initialized

This commit is contained in:
Vern Paxson 2021-02-04 11:39:33 -08:00
parent 183fbc750f
commit e336a30963

View file

@ -983,14 +983,11 @@ TraversalCode RD_Decorate::PreExpr(const Expr* e)
} }
auto fn = hf->FieldName(); auto fn = hf->FieldName();
auto field_rd = id_di->FindField(fn); auto ft = id_rt->GetFieldType(fn);
if ( ! field_rd ) auto field_rd = id_di->CreateField(fn, std::move(ft));
{
auto ft = id_rt->GetFieldType(fn); CreateInitPostDef(field_rd, DefinitionPoint(hf),
field_rd = id_di->CreateField(fn, std::move(ft)); true, 0);
CreateInitPostDef(field_rd, DefinitionPoint(hf),
false, 0);
}
// Don't analyze r itself, since it's not expected // Don't analyze r itself, since it's not expected
// to be defined here. // to be defined here.