[libc-commits] [libc] [libc] Expand usage of libc null checks. (PR #116262)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Fri Jan 17 13:32:57 PST 2025


================
@@ -17,6 +18,8 @@ namespace LIBC_NAMESPACE_DECL {
 
 // TODO: Look at performance benefits of comparing words.
 LLVM_LIBC_FUNCTION(void *, memchr, (const void *src, int c, size_t n)) {
+  const unsigned char *src_cpy = (const unsigned char *)src;
+  LIBC_CRASH_ON_NULLPTR(src_cpy);
----------------
nickdesaulniers wrote:

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

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


More information about the libc-commits mailing list