aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
diff options
context:
space:
mode:
authorRahul Joshi <rjoshi@nvidia.com>2024-08-29 10:39:40 -0700
committerGitHub <noreply@github.com>2024-08-29 10:39:40 -0700
commit9ce4af5cadc24060f3c3674e01902d374afea983 (patch)
tree13feebdf803465cf0b30d12af30cf3b15c30f441 /clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
parent67ffd1438379ee43f678f3e7752f4ec5f777cee4 (diff)
downloadllvm-9ce4af5cadc24060f3c3674e01902d374afea983.zip
llvm-9ce4af5cadc24060f3c3674e01902d374afea983.tar.gz
llvm-9ce4af5cadc24060f3c3674e01902d374afea983.tar.bz2
Revert "Revert "[Support] Validate number of arguments passed to formatv()"" (#106592)
Reverts llvm/llvm-project#106589 The fix for bot failures caused by the reverted commit was committed already, so this revert is not needed.
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
index 8f4bd17..4f30b2a 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
@@ -1401,7 +1401,10 @@ void StdLibraryFunctionsChecker::checkPostCall(const CallEvent &Call,
ErrnoNote =
llvm::formatv("After calling '{0}' {1}", FunctionName, ErrnoNote);
} else {
- CaseNote = llvm::formatv(Case.getNote().str().c_str(), FunctionName);
+ // Disable formatv() validation as the case note may not always have the
+ // {0} placeholder for function name.
+ CaseNote =
+ llvm::formatv(false, Case.getNote().str().c_str(), FunctionName);
}
const SVal RV = Call.getReturnValue();