Index: clang/lib/Lex/PPDirectives.cpp =================================================================== --- clang/lib/Lex/PPDirectives.cpp +++ clang/lib/Lex/PPDirectives.cpp @@ -547,7 +547,7 @@ } SkippingRangeState(*this); while (true) { - if (CurLexer->isDependencyDirectivesLexer()) { + if (CurLexer && CurLexer->isDependencyDirectivesLexer()) { CurLexer->LexDependencyDirectiveTokenWhileSkipping(Tok); } else { SkippingRangeState.beginLexPass();