[clang] [clang][dep-scan] Resolve lexer crash from a permutation of invalid tokens (PR #142452)
Cyndy Ishida via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 2 12:45:10 PDT 2025
================
@@ -503,6 +503,10 @@ bool Scanner::lexModuleDirectiveBody(DirectiveKind Kind, const char *&First,
diag::err_dep_source_scanner_missing_semi_after_at_import);
if (Tok.is(tok::semi))
break;
+ if (Tok.is(tok::hash) || Tok.is(tok::at))
+ return reportError(
----------------
cyndyishida wrote:
I'm not really sure how to do that without introducing some backtracking. AFAICT, as we consume each token, the `First` keeps moving forward.
https://github.com/llvm/llvm-project/pull/142452
More information about the cfe-commits
mailing list