[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:05 PST 2024


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

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)

>From 2bb8fb8c9bd73c0cd973ec029604c5774bd72ae8 Mon Sep 17 00:00:00 2001
From: timurdemenev <311683 at niuitmo.ru>
Date: Thu, 21 Nov 2024 22:40:25 +0300
Subject: [PATCH] Fix wrong name in Compare.h

---
 libc/fuzzing/math/Compare.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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();



More information about the libc-commits mailing list