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

via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 29 02:40:49 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:

It might be because https://github.com/llvm/llvm-project/blob/284bf515feecd0c62adf1f318332b35ed8861c93/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp#L401-L404

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


More information about the cfe-commits mailing list