[clang] [LifetimeSafety] Track origins for lifetimebound calls returning record types (PR #187917)
Zhijie Wang via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 26 09:50:39 PDT 2026
================
@@ -688,9 +707,9 @@ void FactsGenerator::handleFunctionCall(const Expr *Call,
ArgList = getRValueOrigins(Args[I], ArgList);
}
if (isGslOwnerType(Args[I]->getType())) {
- // GSL construction creates a view that borrows from arguments.
- // This implies flowing origins through the list structure.
- flow(CallList, ArgList, KillSrc);
+ CurrentBlockFacts.push_back(FactMgr.createFact<OriginFlowFact>(
----------------
aeft wrote:
// The constructed gsl::Pointer borrows from the Owner's storage, not
// from what the Owner itself borrows, so only the outermost origin is
// needed.
Updated.
`return_dangling_view_through_owner` and `owner_outlives_lifetimebound_source` are related cases.
https://github.com/llvm/llvm-project/pull/187917
More information about the cfe-commits
mailing list