[compiler-rt] Work around a C language bug in libFuzzer (PR #96775)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 13:58:21 PDT 2024


================
@@ -579,6 +579,9 @@ void Fuzzer::CrashOnOverwrittenData() {
 // Compare two arrays, but not all bytes if the arrays are large.
 static bool LooseMemeq(const uint8_t *A, const uint8_t *B, size_t Size) {
   const size_t Limit = 64;
+  // memcmp cannot be passed empty slices when the pointers are null.
----------------
MaskRay wrote:

This sentence seems difficult to read and `slices` isn't a standard term. 

Perhaps `memcmp cannot take null pointer arguments even if Size is 0.` is clearer

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


More information about the llvm-commits mailing list