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

Yixuan Cao via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 25 02:48:57 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)) {
----------------
Cao-Wuhui wrote:

> Don’t use braces on simple single-statement bodies of if/else/loop statements
> https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements

Done: removed braces in `MaybeRealWcsnlen()` and made `MaybeRealStrnlen()` consistent. Submitted as a fixup; will autosquash before landing. Thanks @thurstond.

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


More information about the llvm-commits mailing list