forked from OSchip/llvm-project
c22867f5fc
Summary: The setlocale(3) function reloads the ctype(3) arrays from external files. This happens behind the scenes in the internals of libc (citrus library, runes functions etc). ctype(3) functions like isspace(3) can be provided with two variations on NetBSD: inlined or via a global symbol in libc: ``` #if defined(_NETBSD_SOURCE) && !defined(_CTYPE_NOINLINE) && \ !defined(__cplusplus) #include <sys/ctype_inline.h> #else #include <sys/ctype_bits.h> #endif ``` The in-lined versions are de-facto array lookup operations. ``` #define isspace(c) ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_S)) ``` After setting setlocale(3) the ctype(3) arrays (_ctype_tab_, _toupper_tab_, _tolower_tab_) are reload behind the scenes and they are required to be marked as initialized. Set them initialized inside the common setlocale(3) interceptor. The arrays are of size of 257 elements: 0..255 + 1 (EOF). This corrects errors on NetBSD/amd64 in applications prebuilt with MSan. Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, dvyukov, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42020 llvm-svn: 326008 |
||
---|---|---|
.. | ||
BlocksRuntime | ||
asan | ||
builtins | ||
cfi | ||
dfsan | ||
esan | ||
fuzzer | ||
hwasan | ||
interception | ||
lsan | ||
msan | ||
profile | ||
safestack | ||
sanitizer_common | ||
scudo | ||
tsan | ||
ubsan | ||
ubsan_minimal | ||
xray | ||
CMakeLists.txt | ||
lit.common.cfg | ||
lit.common.configured.in |