You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
strings: make write_decimal handle runtime min_i64 without the min_i64 constant
Address the review on #27522: on the JS backend the min_i64 constant lowers
incorrectly, so the 'if n == min_i64' guard was skipped and a genuine runtime
min_i64 (e.g. from '-9223372036854775808'.i64()) fell into the digit loop where
negating it overflows i64.
Compute the magnitude with wrapping unsigned arithmetic (u64(0) - u64(n)) and
delegate to write_u_decimal instead. This is parity-correct for runtime min_i64
on both backends, removes the dependence on the constant, and drops the
allocating n.str() fallback so the C path is now allocation-free for every input.
0 commit comments