changeset 1365:65505c9d70f5

Added explicit alignment for aggregate __initZ symbols, this is needed for some union types, or the default initializer symbol might be misaligned.
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Sat, 16 May 2009 18:25:01 +0200
parents 46f6365a50d7
children 81121ac19f61
files ir/irstruct.cpp
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ir/irstruct.cpp	Sat May 16 18:19:52 2009 +0200
+++ b/ir/irstruct.cpp	Sat May 16 18:25:01 2009 +0200
@@ -60,6 +60,9 @@
     init = new llvm::GlobalVariable(
         init_pa.get(), true, _linkage, NULL, initname, gIR->module);
 
+    // set alignment
+    init->setAlignment(aggrdecl->alignsize);
+
     return init;
 }