[clang] [clang][analyzer] Remove a copy in a loop in VAListChecker (PR #162620)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 9 02:48:05 PDT 2025


https://github.com/Xazax-hun created https://github.com/llvm/llvm-project/pull/162620

None

>From a96e2f3f358feb9a8b9c5b43d674ed431391d93e Mon Sep 17 00:00:00 2001
From: Gabor Horvath <gaborh at apple.com>
Date: Thu, 9 Oct 2025 10:46:47 +0100
Subject: [PATCH] [clang][analyzer] Remove a copy in a loop in VAListChecker

---
 clang/lib/StaticAnalyzer/Checkers/VAListChecker.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/StaticAnalyzer/Checkers/VAListChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/VAListChecker.cpp
index 79fd0bd4c9dd9..503fa5de868f2 100644
--- a/clang/lib/StaticAnalyzer/Checkers/VAListChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/VAListChecker.cpp
@@ -149,7 +149,7 @@ void VAListChecker::checkPreCall(const CallEvent &Call,
   else if (VaEnd.matches(Call))
     checkVAListEndCall(Call, C);
   else {
-    for (auto FuncInfo : VAListAccepters) {
+    for (const auto &FuncInfo : VAListAccepters) {
       if (!FuncInfo.Func.matches(Call))
         continue;
       const MemRegion *VAList =



More information about the cfe-commits mailing list