[clang] [clang][analyzer] Extend CallAndMessageChecker argument initializedness check (PR #173854)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 4 04:37:15 PST 2026


================
@@ -127,10 +128,35 @@ class CallAndMessageChecker
                          ProgramStateRef state,
                          const ObjCMethodCall &msg) const;
 
-  bool uninitRefOrPointer(CheckerContext &C, SVal V, SourceRange ArgRange,
-                          const Expr *ArgEx, const BugType &BT,
-                          const ParmVarDecl *ParamDecl,
+  bool uninitRefOrPointer(CheckerContext &C, SVal V, const CallEvent &Call,
+                          const BugType &BT, const ParmVarDecl *ParamDecl,
                           int ArgumentNumber) const;
+
+  // C library functions which have a pointer-to-struct parameter that should be
+  // initialized (at least partially) before the call. The 'uninitRefOrPointer'
+  // check uses this data.
+  CallDescriptionMap<int> FunctionsWithInOutPtrParam = {
+      {{CDM::CLibrary, {"mbrlen"}, 3}, 2},
----------------
steakhal wrote:

mbrlen can either have 3 or 4 parameters depending on the C version, right?

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


More information about the cfe-commits mailing list