cameron314 added inline comments. ================ Comment at: lib/Lex/PPLexerChange.cpp:380-383 @@ -379,4 +379,6 @@ CurLexer->FormTokenWithChars(Result, CurLexer->BufferEnd, tok::eof); CurLexer.reset(); + if (CurLexerKind == CLK_Lexer) + CurLexerKind = CLK_CachingLexer; } else { assert(CurPTHLexer && "Got EOF but no current lexer set!"); ---------------- Ah, wait, yes this also prevents the crash if I remove the `CurLexer.reset()` and use `CurLexer->cutOffLexing()`, but it not only produces an error about a missing '}', but an error about an extra '}' just after, which doesn't really make sense. That means it's inspecting tokens past the EOF that was injected.
http://reviews.llvm.org/D20131 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits