Fixed #28 — 64-bit unions are not the same size as C language unions in some situations

This commit is contained in:
Alexey Prokhin
2012-03-06 11:29:30 +04:00
parent f6111f23f2
commit 598942bd78

View File

@@ -233,13 +233,10 @@ void AggregateDeclaration::addField(Scope *sc, VarDeclaration *v)
if (!isUnionDeclaration())
sc->offset = ofs;
#endif
#if !IN_LLVM
if (global.params.is64bit && sc->structalign == 8 && memalignsize == 16)
if (global.params.is64bit && sc->structalign == 8 && memalignsize == 16 && isUnionDeclaration())
/* Not sure how to handle this */
;
else
#endif
if (sc->structalign < memalignsize)
else if (sc->structalign < memalignsize)
memalignsize = sc->structalign;
if (alignsize < memalignsize)
alignsize = memalignsize;