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

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 11:05:58 PST 2018


krytarowski 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));
----------------
vitalybuka wrote:
> 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.
I will prepare the needed patch.


Repository:
  rL LLVM

https://reviews.llvm.org/D42020





More information about the llvm-commits mailing list