[clang] [LifetimeSafety] Track origins through nested subobject fields (PR #232867)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 16 13:02:34 PDT 2026


================
@@ -1248,8 +1263,10 @@ llvm::SmallVector<Fact *> FactsGenerator::issuePlaceholderLoans() {
     const Loan *L = FactMgr.getLoanMgr().createPlaceholderLoan(MD);
     PlaceholderLoanFacts.push_back(
         FactMgr.createFact<IssueFact>(L->getID(), List->getOuterOriginID()));
-    if (LSOpts.CheckFieldOriginEscape && !isa<CXXConstructorDecl>(MD))
-      issueFieldPlaceholderLoans(MD, PlaceholderLoanFacts);
+    if (LSOpts.CheckFieldOriginEscape && !isa<CXXConstructorDecl>(MD)) {
+      if (const auto *ClassDef = MD->getParent()->getDefinition())
----------------
steakhal wrote:

I'm pretty sure `ClassDef` might be null sometimes - but this is why it's in an `if` statement.
I could double check and come up with an explicit test though. - I'll look into this.

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


More information about the cfe-commits mailing list