diff options
author | Ilya Biryukov <ibiryukov@google.com> | 2017-08-21 12:03:08 +0000 |
---|---|---|
committer | Ilya Biryukov <ibiryukov@google.com> | 2017-08-21 12:03:08 +0000 |
commit | f315000613e3f69485b1a2946ab58201b004c35f (patch) | |
tree | c578693e7a19fa9b8f77f225aea66a3fdd06478a /clang/lib/Lex/Preprocessor.cpp | |
parent | 7bc77e87c8c55c2ec68443d4911f2d72fde6fbf0 (diff) | |
download | bcm5719-llvm-f315000613e3f69485b1a2946ab58201b004c35f.tar.gz bcm5719-llvm-f315000613e3f69485b1a2946ab58201b004c35f.zip |
Fixed a crash on replaying Preamble's PP conditional stack.
Summary:
The crash occurs when the first token after a preamble is a macro
expansion.
Fixed by moving replayPreambleConditionalStack from Parser into
Preprocessor. It is now called right after the predefines file is
processed.
Reviewers: erikjv, bkramer, klimek, yvvan
Reviewed By: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D36872
llvm-svn: 311330
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index 158d0eca278..e1294994df5 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -540,6 +540,8 @@ void Preprocessor::EnterMainSourceFile() { void Preprocessor::replayPreambleConditionalStack() { // Restore the conditional stack from the preamble, if there is one. if (PreambleConditionalStack.isReplaying()) { + assert(CurPPLexer && + "CurPPLexer is null when calling replayPreambleConditionalStack."); CurPPLexer->setConditionalLevels(PreambleConditionalStack.getStack()); PreambleConditionalStack.doneReplaying(); } |