From: Reid Kleckner Date: Tue, 13 Dec 2016 19:48:32 +0000 (+0000) Subject: Align EvalInfo in ExprConstant to avoid PointerUnion assertions X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=531f88b4809c3d4154ee7d1f664805fe15709701;p=clang Align EvalInfo in ExprConstant to avoid PointerUnion assertions 32-bit MSVC doesn't provide more than 4 byte stack alignment by default. This conflicts with PointerUnion's attempt to make assertions about alignment. This fixes the problem by explicitly asking the compiler for 8 byte alignment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289575 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 61bb2b9bc9..e18caffc5a 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -433,7 +433,7 @@ namespace { /// rules. For example, the RHS of (0 && foo()) is not evaluated. We can /// evaluate the expression regardless of what the RHS is, but C only allows /// certain things in certain situations. - struct EvalInfo { + struct LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) EvalInfo { ASTContext &Ctx; /// EvalStatus - Contains information about the evaluation.