Fix hasUnalignedFields(): take static arrays into account too.

This commit is contained in:
Frits van Bommel
2009-03-04 23:17:32 +01:00
parent d257890e29
commit cc612c7290

View File

@@ -1571,7 +1571,10 @@ bool needsTemplateLinkage(Dsymbol* s)
bool hasUnalignedFields(Type* t)
{
t = t->toBasetype();
if (t->ty != Tstruct)
if (t->ty == Tsarray) {
assert(t->next->size() % t->next->alignsize() == 0);
return hasUnalignedFields(t->next);
} else if (t->ty != Tstruct)
return false;
TypeStruct* ts = (TypeStruct*)t;