[libc-commits] [libc] [libc] Fix missing UInt initialization (PR #74869)

via libc-commits libc-commits at lists.llvm.org
Fri Dec 8 09:12:33 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Guillaume Chatelet (gchatelet)

<details>
<summary>Changes</summary>

Fix forward for #<!-- -->74862


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


1 Files Affected:

- (modified) libc/src/__support/float_to_string.h (+1-1) 


``````````diff
diff --git a/libc/src/__support/float_to_string.h b/libc/src/__support/float_to_string.h
index 9f24352281fb7..92dd2e8f7e903 100644
--- a/libc/src/__support/float_to_string.h
+++ b/libc/src/__support/float_to_string.h
@@ -653,7 +653,7 @@ FloatToString<long double>::get_positive_block(int block_index) {
 
     // shift_amount = -(c0 - exponent) = c_0 + 16 * ceil(exponent/16) - exponent
 
-    cpp::UInt<MID_INT_SIZE> val;
+    cpp::UInt<MID_INT_SIZE> val(0);
 #ifdef LIBC_COPT_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE
     // ------------------------------ TABLE MODE -------------------------------
     const int32_t SHIFT_CONST = TABLE_SHIFT_CONST;

``````````

</details>


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


More information about the libc-commits mailing list