From 26f9688c69caa1ea8211da7ef072ea6ec292d8f7 Mon Sep 17 00:00:00 2001 From: misomosi Date: Sat, 21 Dec 2024 16:53:31 -0500 Subject: [PATCH] Fix early overwrite of dst w/ exp_u64 --- src/big_int.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/big_int.cpp b/src/big_int.cpp index 8e476f090..0b0a9a400 100644 --- a/src/big_int.cpp +++ b/src/big_int.cpp @@ -251,7 +251,10 @@ gb_internal void big_int_from_string(BigInt *dst, String const &s, bool *success exp *= 10; exp += v; } - big_int_exp_u64(dst, &b, exp, success); + BigInt tmp = {}; + mp_init(&tmp); + big_int_exp_u64(&tmp, &b, exp, success); + big_int_mul_eq(dst, &tmp); } if (is_negative) {