Skip to content

Commit

Permalink
Fix early overwrite of dst w/ exp_u64
Browse files Browse the repository at this point in the history
  • Loading branch information
tf2spi committed Dec 21, 2024
1 parent 8f2766c commit 26f9688
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/big_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 26f9688

Please sign in to comment.