[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 07:51:15 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:
```suggestion
const char *CommentEnd = nullptr;
```
We tend to use `=` rather than `{}` for in-class initializers, at least from my looking around at other ones. It's identical functionality though, so just a style nit.
https://github.com/llvm/llvm-project/pull/210067
More information about the cfe-commits
mailing list