[libc-commits] [libc] 3596005 - Fix wide read defaults

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Thu Aug 21 06:17:13 PDT 2025


Author: Joseph Huber
Date: 2025-08-21T08:17:06-05:00
New Revision: 35960051488997228ba995ccd3665719c6682fa0

URL: https://github.com/llvm/llvm-project/commit/35960051488997228ba995ccd3665719c6682fa0
DIFF: https://github.com/llvm/llvm-project/commit/35960051488997228ba995ccd3665719c6682fa0.diff

LOG: Fix wide read defaults

Added: 
    libc/config/linux/riscv/config.json

Modified: 
    libc/src/string/memory_utils/x86_64/inline_strlen.h

Removed: 
    


################################################################################
diff  --git a/libc/config/linux/riscv/config.json b/libc/config/linux/riscv/config.json
new file mode 100644
index 0000000000000..e7ad4544b104d
--- /dev/null
+++ b/libc/config/linux/riscv/config.json
@@ -0,0 +1,7 @@
+{
+  "string": {
+    "LIBC_CONF_STRING_UNSAFE_WIDE_READ": {
+      "value": false
+    }
+  }
+}

diff  --git a/libc/src/string/memory_utils/x86_64/inline_strlen.h b/libc/src/string/memory_utils/x86_64/inline_strlen.h
index 6dad6acc08928..739f8c1aaddbc 100644
--- a/libc/src/string/memory_utils/x86_64/inline_strlen.h
+++ b/libc/src/string/memory_utils/x86_64/inline_strlen.h
@@ -18,7 +18,8 @@ namespace LIBC_NAMESPACE_DECL {
 namespace string_length_internal {
 // Return a bit-mask with the nth bit set if the nth-byte in block_ptr is zero.
 template <typename Vector, typename Mask>
-LIBC_INLINE static Mask compare_and_mask(const Vector *block_ptr);
+[[gnu::no_sanitize_address]] LIBC_INLINE static Mask
+compare_and_mask(const Vector *block_ptr);
 
 template <typename Vector, typename Mask,
           decltype(compare_and_mask<Vector, Mask>)>


        


More information about the libc-commits mailing list