Files
clang-p2996/compiler-rt/test/msan/sigaltstack.cpp
Evgenii Stepanov 987f153929 [msan] Fix sigaltstack false positive.
struct stack_t on Linux x86_64 has internal padding which may be left
uninitialized. The check should be replaced with multiple checks for
individual fields of the struct. For now, remove the check altogether.
2020-03-23 16:17:31 -07:00

16 lines
290 B
C++

// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t
//
#include <signal.h>
#include <assert.h>
#include <sanitizer/msan_interface.h>
int main(void) {
stack_t old_ss;
assert(sigaltstack(nullptr, &old_ss) == 0);
__msan_check_mem_is_initialized(&old_ss, sizeof(stack_t));
return 0;
}