|
1 # 17867434 clang crashed in LEXER |
|
2 # 3.9.X for upstream. |
|
3 --- tools/clang/include/clang/Lex/MacroArgs.h 2015-04-11 11:58:30.000000000 -0400 |
|
4 +++ tools/clang/include/clang/Lex/MacroArgs.h 2016-05-08 23:19:20.554431288 -0400 |
|
5 @@ -15,13 +15,13 @@ |
|
6 #define LLVM_CLANG_LEX_MACROARGS_H |
|
7 |
|
8 #include "clang/Basic/LLVM.h" |
|
9 +#include "clang/Lex/Token.h" |
|
10 #include "llvm/ADT/ArrayRef.h" |
|
11 #include <vector> |
|
12 |
|
13 namespace clang { |
|
14 class MacroInfo; |
|
15 class Preprocessor; |
|
16 - class Token; |
|
17 class SourceLocation; |
|
18 |
|
19 /// MacroArgs - An instance of this class captures information about |
|
20 @@ -121,6 +121,9 @@ |
|
21 /// its freelist. |
|
22 MacroArgs *deallocate(); |
|
23 }; |
|
24 +static_assert(llvm::AlignOf<MacroArgs>::Alignment >= |
|
25 + llvm::AlignOf<Token>::Alignment, |
|
26 + "Alignment is insufficient for objects appended to MacroArgs"); |
|
27 |
|
28 } // end namespace clang |
|
29 |
|
30 --- tools/clang/include/clang/Lex/MacroInfo.h 2015-10-22 00:59:52.000000000 -0400 |
|
31 +++ tools/clang/include/clang/Lex/MacroInfo.h 2016-05-08 23:19:20.554431288 -0400 |
|
32 @@ -295,6 +295,10 @@ |
|
33 friend class Preprocessor; |
|
34 }; |
|
35 |
|
36 +static_assert(llvm::AlignOf<MacroInfo>::Alignment >= |
|
37 + llvm::AlignOf<unsigned>::Alignment, |
|
38 + "Alignment is insufficient for objects appended to MacroInfo"); |
|
39 + |
|
40 class DefMacroDirective; |
|
41 |
|
42 /// \brief Encapsulates changes to the "macros namespace" (the location where |
|
43 @@ -315,16 +319,16 @@ |
|
44 SourceLocation Loc; |
|
45 |
|
46 /// \brief MacroDirective kind. |
|
47 - unsigned MDKind : 2; |
|
48 + unsigned MDKind; |
|
49 |
|
50 /// \brief True if the macro directive was loaded from a PCH file. |
|
51 - bool IsFromPCH : 1; |
|
52 + bool IsFromPCH; |
|
53 |
|
54 // Used by VisibilityMacroDirective ----------------------------------------// |
|
55 |
|
56 /// \brief Whether the macro has public visibility (when described in a |
|
57 /// module). |
|
58 - bool IsPublic : 1; |
|
59 + bool IsPublic; |
|
60 |
|
61 MacroDirective(Kind K, SourceLocation Loc) |
|
62 : Previous(nullptr), Loc(Loc), MDKind(K), IsFromPCH(false), |
|
63 @@ -556,6 +560,10 @@ |
|
64 unsigned getNumOverridingMacros() const { return NumOverriddenBy; } |
|
65 }; |
|
66 |
|
67 +static_assert(llvm::AlignOf<ModuleMacro>::Alignment >= |
|
68 + llvm::AlignOf<ModuleMacro *>::Alignment, |
|
69 + "Alignment is insufficient for objects appended to ModuleMacro"); |
|
70 + |
|
71 /// \brief A description of the current definition of a macro. |
|
72 /// |
|
73 /// The definition of a macro comprises a set of (at least one) defining |
|
74 |