From cc612c7290aa5cfd97c4c312fa87bdfd0c478df9 Mon Sep 17 00:00:00 2001 From: Frits van Bommel Date: Wed, 4 Mar 2009 23:17:32 +0100 Subject: [PATCH] Fix hasUnalignedFields(): take static arrays into account too. --- gen/llvmhelpers.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index 0f901ecd..07a0206e 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -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;