[llvm-branch-commits] [clang] [analyzer] Replace getAdjustedParameterIndex with getDeclaredParameterIndex in CallEvent.cpp (PR #221727)

Benedek Kaibas via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Sep 7 06:24:07 PDT 2026


https://github.com/benedekaibas created https://github.com/llvm/llvm-project/pull/221727

None

>From b864364327448505a9d2911de02cb3f55c72fe06 Mon Sep 17 00:00:00 2001
From: benedekaibas <kaibas01 at allegheny.edu>
Date: Mon, 7 Sep 2026 15:22:38 +0200
Subject: [PATCH] [analyzer] Replace getAdjustedParameterIndex with
 getDeclaredParameterIndex in CallEvent.cpp

---
 clang/lib/StaticAnalyzer/Core/CallEvent.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
index 8eab3f19dc0a8..cbcc0c7d3b717 100644
--- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -285,10 +285,10 @@ ProgramStateRef CallEvent::invalidateRegions(unsigned BlockCount,
     // TODO: This is unnecessary when there's no destructor, but that's
     // currently hard to figure out.
     if (getKind() != CE_CXXAllocator)
-      if (isArgumentConstructedDirectly(Idx))
-        if (auto AdjIdx = getAdjustedParameterIndex(Idx))
+      if (isArgumentConstructedDirectly(getASTArgumentIndex(Idx)))
+        if (std::optional<unsigned> DeclParamIdx = getDeclaredParameterIndex(Idx))
           if (const TypedValueRegion *TVR =
-                  getParameterLocation(*AdjIdx, BlockCount))
+                  getParameterLocation(*DeclParamIdx, BlockCount))
             ValuesToInvalidate.push_back(loc::MemRegionVal(TVR));
   }
 



More information about the llvm-branch-commits mailing list