summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-18 05:55:53 +0000
committerChris Lattner <sabre@nondot.org>2009-06-18 05:55:53 +0000
commite7e659431c231be662dd954d66a18fdc9914e27a (patch)
tree6161e2e7f7e815f6f07cb2a09077e3ab07784f08 /clang
parent8527e674ce474c2927742042422ed5743b3f4101 (diff)
downloadbcm5719-llvm-e7e659431c231be662dd954d66a18fdc9914e27a.tar.gz
bcm5719-llvm-e7e659431c231be662dd954d66a18fdc9914e27a.zip
Fix a crash that can occur when a #pragma handler eats to the end of the
line, and when the pragma is at the end of a file. In this case, the last token consumed could pop the lexer, invalidating CurPPLexer. Thanks to Peter Thoman for pointing it out. llvm-svn: 73689
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Lex/Pragma.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp
index 9776c2cfbd9..3227d1cf09c 100644
--- a/clang/lib/Lex/Pragma.cpp
+++ b/clang/lib/Lex/Pragma.cpp
@@ -93,7 +93,7 @@ void Preprocessor::HandlePragmaDirective() {
PragmaHandlers->HandlePragma(*this, Tok);
// If the pragma handler didn't read the rest of the line, consume it now.
- if (CurPPLexer->ParsingPreprocessorDirective)
+ if (CurPPLexer && CurPPLexer->ParsingPreprocessorDirective)
DiscardUntilEndOfDirective();
}
OpenPOWER on IntegriCloud