[clang] Fix Unintialised char *CommentLexer resulting in potential UB. (PR #210067)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 16 09:01:05 PDT 2026


================
@@ -240,7 +240,7 @@ class Lexer {
 
   /// One past end pointer for the current comment.  For BCPL comments points
   /// to newline or BufferEnd, for C comments points to star in '*/'.
-  const char *CommentEnd;
+  const char *CommentEnd{nullptr};
----------------
AaronBallman wrote:

Heh, it might not even be a bad habit, FWIW. Our coding style is sometimes a bit odd (it's not always following modern best practices because we don't want to churn the code base for stylistic things).

https://github.com/llvm/llvm-project/pull/210067


More information about the cfe-commits mailing list