changeset 1044:39f12f5aa515

Fix hasUnalignedFields(): take static arrays into account too.
author Frits van Bommel <fvbommel wxs.nl>
date Wed, 04 Mar 2009 23:17:32 +0100
parents 0485751a40ae
children a91d6fc600cd
files gen/llvmhelpers.cpp
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gen/llvmhelpers.cpp	Wed Mar 04 23:06:23 2009 +0100
+++ b/gen/llvmhelpers.cpp	Wed Mar 04 23:17:32 2009 +0100
@@ -1571,7 +1571,10 @@
 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;