[clang] [LifetimeSafety] Detect use-after-return (PR #165370)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 6 14:13:21 PST 2025


================
@@ -93,6 +93,9 @@ class FactsGenerator : public ConstStmtVisitor<FactsGenerator> {
   FactManager &FactMgr;
   AnalysisDeclContext &AC;
   llvm::SmallVector<Fact *> CurrentBlockFacts;
+  // Collect origins that escape the function in this block. These are handled
+  // at the end of the block to ensure `OEFs` appear after `Expire` facts.
+  llvm::SmallVector<Fact *> EscapesInCurrentBlock;
----------------
usx95 wrote:

we can be more precise and explicit about the intention `llvm::SmallVector< OriginEscapesFact *>`

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


More information about the cfe-commits mailing list