Add the __msan_va_arg_origin_tls TLS array to keep the origins for variadic function parameters.
Change the instrumentation pass to store parameter origins in this array.
Details
Diff Detail
Event Timeline
Please add a test for accessing origin of a va_arg argument in the callee.
Please add a compiler-rt test (or extend an existing one).
projects/compiler-rt/test/msan/vararg.cc | ||
---|---|---|
36 | I've started writing such a test, and noticed that when I call a function with 85 int arguments it passes wrong shadow of (at least) the first argument to the callee. |
To be precise, calling sum(84, init1, ..., init84, uninit) results in init1 having non-zero shadow in the callee.
Added the test for overflow area.
The aforementioned problem with too many arguments is handled in https://reviews.llvm.org/D51627
Updated the patch before relanding.
test/msan/vararg.cc doesn't work on Mips, PPC and AArch64 (because this patch doesn't touch them), so I XFAIL these arches.
Also turned out Clang crashed on i80 vararg arguments because of incorrect origin type returned by getOriginPtrForVAArgument().
I've fixed it and added a test.
why __builtin?