forked from OSchip/llvm-project
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:
parent
8527e674ce
commit
e7e659431c
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue