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

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 11:00:09 PST 2018

vitalybuka added inline comments.

Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:3174
+    // Valid array indices: -1 (EOF), 0, 1, .. 255
+    COMMON_INTERCEPTOR_WRITE_RANGE(ctx, _ctype_tab_, 257 * sizeof(short));
vitalybuka wrote:
> 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?
And it would be nice to have a test which fails on NetBsd without this change.



More information about the llvm-commits mailing list