[llvm-branch-commits] [clang] [LifetimeSafety] Do not create two loans for the same expression (PR #153669)
Utkarsh Saxena via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Aug 14 13:18:37 PDT 2025
https://github.com/usx95 created https://github.com/llvm/llvm-project/pull/153669
None
>From e61817a17681c47a4369bdd1cce85940d02b2420 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena <usx at google.com>
Date: Thu, 14 Aug 2025 19:54:49 +0000
Subject: [PATCH] [LifetimeSafety] Do not create two loans for the same
expression
---
clang/lib/Analysis/LifetimeSafety.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/clang/lib/Analysis/LifetimeSafety.cpp b/clang/lib/Analysis/LifetimeSafety.cpp
index 0e3f7c8590803..d5d7e20a9f0cd 100644
--- a/clang/lib/Analysis/LifetimeSafety.cpp
+++ b/clang/lib/Analysis/LifetimeSafety.cpp
@@ -396,6 +396,7 @@ class FactGenerator : public ConstStmtVisitor<FactGenerator> {
// initializations and destructions are processed in the correct sequence.
for (const CFGBlock *Block : *AC.getAnalysis<PostOrderCFGView>()) {
CurrentBlockFacts.clear();
+ VisitedStmts.clear();
for (unsigned I = 0; I < Block->size(); ++I) {
const CFGElement &Element = Block->Elements[I];
if (std::optional<CFGStmt> CS = Element.getAs<CFGStmt>()) {
More information about the llvm-branch-commits
mailing list