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
This commit is contained in:
Chris Lattner 2009-06-18 05:55:53 +00:00
parent 8527e674ce
commit e7e659431c
1 changed files with 1 additions and 1 deletions

View File

@ -93,7 +93,7 @@ void Preprocessor::HandlePragmaDirective() {
PragmaHandlers->HandlePragma(*this, Tok); PragmaHandlers->HandlePragma(*this, Tok);
// If the pragma handler didn't read the rest of the line, consume it now. // If the pragma handler didn't read the rest of the line, consume it now.
if (CurPPLexer->ParsingPreprocessorDirective) if (CurPPLexer && CurPPLexer->ParsingPreprocessorDirective)
DiscardUntilEndOfDirective(); DiscardUntilEndOfDirective();
} }