From 2e33a6af9fd51551418f2f07eb6c9f72ee158eb1 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Sat, 16 May 2009 18:25:01 +0200 Subject: [PATCH] Added explicit alignment for aggregate __initZ symbols, this is needed for some union types, or the default initializer symbol might be misaligned. --- ir/irstruct.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ir/irstruct.cpp b/ir/irstruct.cpp index b058596c..96be3e40 100644 --- a/ir/irstruct.cpp +++ b/ir/irstruct.cpp @@ -60,6 +60,9 @@ LLGlobalVariable * IrStruct::getInitSymbol() init = new llvm::GlobalVariable( init_pa.get(), true, _linkage, NULL, initname, gIR->module); + // set alignment + init->setAlignment(aggrdecl->alignsize); + return init; }