[clang] Adding use-after-return in Lifetime Analysis (PR #165370)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 30 12:28:26 PDT 2025


================
@@ -106,6 +120,63 @@ class LifetimeChecker {
                                      /*ConfidenceLevel=*/CurConfidence};
   }
 
+  void checkEscape(const OriginEscapesFact *OEF,
----------------
usx95 wrote:

I think if we correctly use the liveness information, `checkExpiry` can deal with `use-after-return` as well. 
`Liveness` can tell the if origin is live because of an `OriginEscape`, we can mark the loan with a  use-after-return violation.

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


More information about the cfe-commits mailing list