[clang] [analyzer] Detect leaks of stack addresses via output params, indirect globals 3/3 (PR #105648)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 27 02:06:40 PDT 2024


================
@@ -424,6 +481,9 @@ void StackAddrEscapeChecker::checkEndFunction(const ReturnStmt *RS,
   for (const auto &P : Cb.V) {
     const MemRegion *Referrer = P.first->getBaseRegion();
     const MemRegion *Referred = P.second;
+    if (Cb.ExcludedRegions.contains(getOriginBaseRegion(Referrer))) {
----------------
NagyDonat wrote:

It's a bit inconsistent that you use the recursive `getOriginBaseRegion(Referrer)` here, while in `recordInvalidatedRegions()` you just call `Symbol->getOriginRegion()->getBaseRegion()` once. Consider using the same logic in both situations.

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


More information about the cfe-commits mailing list