[PATCH] D42020: Correct ctype(3) functions with NLS on NetBSD

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 14 17:53:48 PST 2018


vitalybuka added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:3174
+#if SANITIZER_NETBSD
+    // Valid array indices: -1 (EOF), 0, 1, .. 255
+    COMMON_INTERCEPTOR_WRITE_RANGE(ctx, _ctype_tab_, 257 * sizeof(short));
----------------
krytarowski wrote:
> vitalybuka wrote:
> > should this be done only for category == LC_CTYPE 
> It's possible to add if() for LC_CTYPE || LC_ALL, but I would need to define it in sanitizer_platform_limits_netbsd.*.
> 
> In real life, I'm not sure that this is really needed, overhead is negligible and hardly ever we will execute this code needlessly.
Can please create SetLocale() (or better name). Define it in sanitizer_netbsd.cpp and define empty one for other platforms?


Repository:
  rL LLVM

https://reviews.llvm.org/D42020





More information about the llvm-commits mailing list