[clang] [analyzer] Fix security.VAList false positives with C23 va_start (PR #192024)
Balázs Benics via cfe-commits
cfe-commits at lists.llvm.org
Fri May 1 04:33:42 PDT 2026
================
@@ -136,13 +136,14 @@ const SmallVector<VAListChecker::VAListAccepter, 15>
const CallDescription VAListChecker::VaStart(CDM::CLibrary,
{"__builtin_va_start"}, /*Args=*/2,
/*Params=*/1),
+ VAListChecker::VaStartC23(CDM::CLibrary, {"__builtin_c23_va_start"}),
VAListChecker::VaCopy(CDM::CLibrary, {"__builtin_va_copy"}, 2),
VAListChecker::VaEnd(CDM::CLibrary, {"__builtin_va_end"}, 1);
} // end anonymous namespace
void VAListChecker::checkPreCall(const CallEvent &Call,
CheckerContext &C) const {
- if (VaStart.matches(Call))
+ if (VaStart.matches(Call) || VaStartC23.matches(Call))
----------------
steakhal wrote:
Shouldn't `Call.matches(VaStart, VaStartC23)` work?
https://github.com/llvm/llvm-project/pull/192024
More information about the cfe-commits
mailing list