File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Original file line number Diff line number Diff line change @@ -2852,7 +2852,8 @@ _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e)
2852
2852
{
2853
2853
Py_ssize_t a_size , a_bits , shift_digits , shift_bits , x_size ;
2854
2854
/* See below for why x_digits is always large enough. */
2855
- digit rem , x_digits [2 + (DBL_MANT_DIG + 1 ) / PyLong_SHIFT ];
2855
+ digit rem ;
2856
+ digit x_digits [2 + (DBL_MANT_DIG + 1 ) / PyLong_SHIFT ] = {0 ,};
2856
2857
double dx ;
2857
2858
/* Correction term for round-half-to-even rounding. For a digit x,
2858
2859
"x + half_even_correction[x & 7]" gives x rounded to the nearest
@@ -2902,9 +2903,7 @@ _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e)
2902
2903
if (a_bits <= DBL_MANT_DIG + 2 ) {
2903
2904
shift_digits = (DBL_MANT_DIG + 2 - a_bits ) / PyLong_SHIFT ;
2904
2905
shift_bits = (DBL_MANT_DIG + 2 - a_bits ) % PyLong_SHIFT ;
2905
- x_size = 0 ;
2906
- while (x_size < shift_digits )
2907
- x_digits [x_size ++ ] = 0 ;
2906
+ x_size = shift_digits ;
2908
2907
rem = v_lshift (x_digits + x_size , a -> ob_digit , a_size ,
2909
2908
(int )shift_bits );
2910
2909
x_size += a_size ;
You can’t perform that action at this time.
0 commit comments