[compiler-rt] [compiler-rt][asan] Add wcscpy/wcsncpy; enable wcscat/wcsncat on Windows (PR #160493)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 24 09:26:30 PDT 2025


================
@@ -65,6 +65,15 @@ static inline uptr MaybeRealStrnlen(const char *s, uptr maxlen) {
   return internal_strnlen(s, maxlen);
 }
 
+static inline uptr MaybeRealWcsnlen(const wchar_t *s, uptr maxlen) {
+#if SANITIZER_INTERCEPT_WCSNLEN
+  if (REAL(wcsnlen)) {
----------------
thurstond wrote:

Please follow https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements
(even though existing code, such as MaybeRealStrnlen() above, does not follow this convention)


https://github.com/llvm/llvm-project/pull/160493


More information about the llvm-commits mailing list