================
@@ -544,7 +544,7 @@ Scanner::lexIncludeFilename(const char *&First, const char 
*const End) {
 void Scanner::lexPPDirectiveBody(const char *&First, const char *const End) {
   while (true) {
     const dependency_directives_scan::Token &Tok = lexToken(First, End);
-    if (Tok.is(tok::eod))
+    if (Tok.is(tok::eod) || Tok.is(tok::eof))
----------------
Bigcheese wrote:

Does this end up with the entire rest of the file being part of the directive? 
I think another issue here is that the lexer does not consider the newline at 
the end of the import as `eod`.

I think the change is still fine though, it's better to not infinite loop even 
if the lexer is wrong.

https://github.com/llvm/llvm-project/pull/99520
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to