]> granicus.if.org Git - clang/commitdiff
Align EvalInfo in ExprConstant to avoid PointerUnion assertions
authorReid Kleckner <rnk@google.com>
Tue, 13 Dec 2016 19:48:32 +0000 (19:48 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 13 Dec 2016 19:48:32 +0000 (19:48 +0000)
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

lib/AST/ExprConstant.cpp

index 61bb2b9bc91fdcbf8dc89c360539db0974a4e92c..e18caffc5af054778cd23ebe87f8727bc78418ab 100644 (file)
@@ -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.