[libc-commits] [libc] Turn LIBC_COPT_STRING_UNSAFE_WIDE_READ on by default (PR #144163)

Amy Huang via libc-commits libc-commits at lists.llvm.org
Fri Jun 13 14:29:44 PDT 2025


https://github.com/amykhuang created https://github.com/llvm/llvm-project/pull/144163

Configure strlen to use unsafe implementation because it is faster.

Because this is undefined behavior it could cause sanitizers to fail.

>From ef865ec0252d49d85b92eec07f3105d6aea6f4bd Mon Sep 17 00:00:00 2001
From: Amy Huang <akhuang at google.com>
Date: Fri, 13 Jun 2025 14:12:50 -0700
Subject: [PATCH] Turn LIBC_COPT_STRING_UNSAFE_WIDE_READ on by default

---
 libc/config/config.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/config/config.json b/libc/config/config.json
index d53b2936edb07..0354b16997cdd 100644
--- a/libc/config/config.json
+++ b/libc/config/config.json
@@ -59,7 +59,7 @@
   },
   "string": {
     "LIBC_CONF_STRING_UNSAFE_WIDE_READ": {
-      "value": false,
+      "value": true,
       "doc": "Read more than a byte at a time to perform byte-string operations like strlen."
     },
     "LIBC_CONF_MEMSET_X86_USE_SOFTWARE_PREFETCHING": {



More information about the libc-commits mailing list