https://github.com/ianayl updated 
https://github.com/llvm/llvm-project/pull/211117

>From 948076a3d93f442975b152d45bb4029d8e20c40f Mon Sep 17 00:00:00 2001
From: "Li, Ian" <[email protected]>
Date: Tue, 21 Jul 2026 14:14:47 -0700
Subject: [PATCH 1/2] Add assert on CurPPLexer

---
 clang/lib/Lex/Preprocessor.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 427a3826b299a..4bbf72ec9f611 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -1353,6 +1353,9 @@ bool Preprocessor::HandleModuleContextualKeyword(Token 
&Result) {
   } else if (!Result.isAtPhysicalStartOfLine())
     return false;
 
+  assert(CurPPLexer &&
+         "CurPPLexer is null when calling HandleModuleContextualKeyword.");
+
   llvm::SaveAndRestore<bool> SavedParsingPreprocessorDirective(
       CurPPLexer->ParsingPreprocessorDirective, true);
 

>From 29575ad141ce012f6c951eb1927832e4eaed9c1c Mon Sep 17 00:00:00 2001
From: Ian Li <[email protected]>
Date: Thu, 23 Jul 2026 11:08:11 -0400
Subject: [PATCH 2/2] Update clang/lib/Lex/Preprocessor.cpp

Co-authored-by: Yihan Wang <[email protected]>
---
 clang/lib/Lex/Preprocessor.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 4bbf72ec9f611..bac84d1761a38 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -1354,7 +1354,7 @@ bool Preprocessor::HandleModuleContextualKeyword(Token 
&Result) {
     return false;
 
   assert(CurPPLexer &&
-         "CurPPLexer is null when calling HandleModuleContextualKeyword.");
+         "CurPPLexer must not be null");
 
   llvm::SaveAndRestore<bool> SavedParsingPreprocessorDirective(
       CurPPLexer->ParsingPreprocessorDirective, true);

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to