- fixed: The struct field compiler did not check for forward declared type references that hadn't been resolved yet.

This commit is contained in:
Christoph Oelckers 2017-08-27 12:31:47 +02:00
parent 485c4c71b5
commit 948e50e458
2 changed files with 6 additions and 0 deletions

View file

@ -2247,6 +2247,7 @@ bool PStruct::ReadValue(FSerializer &ar, const char *key, void *addr) const
PField *PStruct::AddField(FName name, PType *type, uint32_t flags)
{
assert(type->Size > 0);
return Symbols.AddField(name, type, flags, Size, &Align);
}

View file

@ -1298,6 +1298,11 @@ bool ZCCCompiler::CompileFields(PContainerType *type, TArray<ZCC_VarDeclarator *
auto name = field->Names;
do
{
if (fieldtype->Size == 0 && !(varflags & VARF_Native)) // Size not known yet.
{
return false;
}
if (AddTreeNode(name->Name, name, TreeNodes, !forstruct))
{
auto thisfieldtype = fieldtype;