[libc-commits] [libc] Fix wrong name in Compare.h (PR #117223)

via libc-commits libc-commits at lists.llvm.org
Thu Nov 21 11:49:59 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Chuvak (ChuvakHome)

<details>
<summary>Changes</summary>

Fix for some mistakes in source code found using PVS Studio.

Inspired by: https://pvs-studio.com/en/blog/posts/cpp/1188/

Fixed:
- [Bug 5](https://pvs-studio.com/en/blog/posts/cpp/1188/#IDF23EA2CEAB)

---
Full diff: https://github.com/llvm/llvm-project/pull/117223.diff


1 Files Affected:

- (modified) libc/fuzzing/math/Compare.h (+1-1) 


``````````diff
diff --git a/libc/fuzzing/math/Compare.h b/libc/fuzzing/math/Compare.h
index 2b84ad3ab46213..8f06ed9c8cc102 100644
--- a/libc/fuzzing/math/Compare.h
+++ b/libc/fuzzing/math/Compare.h
@@ -20,7 +20,7 @@ ValuesEqual(T x1, T x2) {
   LIBC_NAMESPACE::fputil::FPBits<T> bits2(x2);
   // If either is NaN, we want both to be NaN.
   if (bits1.is_nan() || bits2.is_nan())
-    return bits2.is_nan() && bits2.is_nan();
+    return bits1.is_nan() && bits2.is_nan();
 
   // For all other values, we want the values to be bitwise equal.
   return bits1.uintval() == bits2.uintval();

``````````

</details>


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


More information about the libc-commits mailing list