[clang] [clang][analyzer] Add support for detecting uninitialized dynamically-allocated objects (PR #193001)

via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 23 08:36:43 PDT 2026


================
@@ -451,26 +451,44 @@ static void printTail(llvm::raw_ostream &Out,
 //                           Utility functions.
 //===----------------------------------------------------------------------===//
 
+static const SubRegion *
+getConstructedSubRegion(const CXXConstructorDecl *CtorDecl,
+                        CheckerContext &Context) {
+  Loc ThisLoc =
+      Context.getSValBuilder().getCXXThis(CtorDecl, Context.getStackFrame());
+  SVal ObjectV = Context.getState()->getSVal(ThisLoc);
----------------
guillem-bartrina-sonarsource wrote:

I'd be the first to want that esoteric construction that gets us that desired Unknown region, but it doesn't look easy (or even possible). Do you think we can go ahead and merge this patch?

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


More information about the cfe-commits mailing list