[llvm-branch-commits] [clang] liveness-based-lifetime-policy (PR #159991)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Sep 21 09:37:30 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- clang/include/clang/Analysis/Analyses/LifetimeSafety.h clang/lib/Analysis/LifetimeSafety.cpp clang/unittests/Analysis/LifetimeSafetyTest.cpp
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Analysis/LifetimeSafety.cpp b/clang/lib/Analysis/LifetimeSafety.cpp
index 084cd8b4d..b91a5c60b 100644
--- a/clang/lib/Analysis/LifetimeSafety.cpp
+++ b/clang/lib/Analysis/LifetimeSafety.cpp
@@ -1395,12 +1395,14 @@ public:
// // Get the set of all loans that have expired at this program point.
// ExpiredLoanMap AllExpiredLoans = ExpiredLoans.getExpiredLoans(UF);
- // // If the pointer holds no loans or no loans have expired, there's nothing
+ // // If the pointer holds no loans or no loans have expired, there's
+ // nothing
// // to check.
// if (HeldLoans.isEmpty() || AllExpiredLoans.isEmpty())
// return;
- // // Identify loans that which have expired but are held by the pointer. Using
+ // // Identify loans that which have expired but are held by the pointer.
+ // Using
// // them is a use-after-free.
// llvm::SmallVector<LoanID> DefaultedLoans;
// // A definite UaF error occurs if all loans the origin might hold have
@@ -1410,8 +1412,8 @@ public:
// if (AllExpiredLoans.contains(L))
// DefaultedLoans.push_back(L);
// else
- // // If at least one loan is not expired, this use is not a definite UaF.
- // IsDefiniteError = false;
+ // // If at least one loan is not expired, this use is not a definite
+ // UaF. IsDefiniteError = false;
// }
// // If there are no defaulted loans, the use is safe.
// if (DefaultedLoans.empty())
@@ -1426,7 +1428,8 @@ public:
// // If we already have a warning for this loan with a higher or equal
// // confidence, skip this one.
// if (FinalWarningsMap.count(DefaultedLoan) &&
- // CurrentConfidence <= FinalWarningsMap[DefaultedLoan].ConfidenceLevel)
+ // CurrentConfidence <=
+ // FinalWarningsMap[DefaultedLoan].ConfidenceLevel)
// continue;
// auto *EF = AllExpiredLoans.lookup(DefaultedLoan);
``````````
</details>
https://github.com/llvm/llvm-project/pull/159991
More information about the llvm-branch-commits
mailing list