[clang] [LifetimeSafety] Track origins through nested subobject fields (PR #232867)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 16 13:00:06 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())
----------------
NeKon69 wrote:
This is a bit of a stretch, but I believe `ClassDef` should always be non nullptr since we are currently analyzing the body. The assertion in `issueFieldPlaceholderLoans` will trigger if that isn't true.
https://github.com/llvm/llvm-project/pull/232867
More information about the cfe-commits
mailing list