[clang-tools-extra] [NFC] Fix uninitialized pointer field. (PR #117173)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 21 07:36:22 PST 2024


================
@@ -23,7 +23,7 @@ AST_MATCHER(StringLiteral, isOrdinary) { return Node.isOrdinary(); }
 } // namespace
 
 UseStdPrintCheck::UseStdPrintCheck(StringRef Name, ClangTidyContext *Context)
-    : ClangTidyCheck(Name, Context),
+    : ClangTidyCheck(Name, Context), PP(PP),
----------------
AaronBallman wrote:

You should also add an `assert` to `check()` before we dereference `PP` to ensure it's non-null.

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


More information about the cfe-commits mailing list