[clang] [analyzer] Fix VAListChecker for by-value va_list (PR #245289)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 23 08:54:31 PST 2026
================
@@ -0,0 +1,162 @@
+// RUN: %clang_analyze_cc1 -triple aarch64-unknown-linux-gnu \
+// RUN: -analyzer-checker=core,security.VAList -verify %s
+// RUN: %clang_analyze_cc1 -triple x86_64-unknown-linux-gnu \
+// RUN: -analyzer-checker=core,security.VAList -verify %s
+
+// Tests for recovering the state of a va_list that is passed to a function
+// by value (on AArch64 va_list is a struct, and the analyzer core does not
+// propagate the checker's per-region state to the callee's parameter copy).
+
+#include <stdarg.h>
----------------
NagyDonat wrote:
We never include standard headers in these LIT tests, because they need to be analyzed as isolated units, without influence from the system headers that happen to be installed on the system where they are executed. Create a mock system header under `clang/test/Analysis/Inputs` that contains the definitions that are necessary for you (based on the `stdarg.h` implementation that defines `va_list` as a struct), and use that mock header instead of the real one.
https://github.com/llvm/llvm-project/pull/245289
More information about the cfe-commits
mailing list