authorgravatar for ashe@kivikakk.eeAsherah Connor <ashe@kivikakk.ee> 2021-03-22 23:42:16+11:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2021-06-11 16:18:10+03:00
logb15e2054384ba683499138fcad0a9503f3aa9e0b
tree3de9051bfdae4467f34825195f8c9293589dd221
parent1db6018140c20df558fc0259ae0eb28e2e08330f

bigint: use a stack local here to prevent aliasing issues


1 files changed, 3 insertions(+), 1 deletions(-)

lib/std/math/big/int.zig+3-1
......@@ -316,7 +316,9 @@ pub const Mutable = struct {
316316 }
317317
318318 if (a.limbs.len == 1 and b.limbs.len == 1 and a.positive == b.positive) {
319 if (!@addWithOverflow(Limb, a.limbs[0], b.limbs[0], &r.limbs[0])) {
319 var o: Limb = undefined;
320 if (!@addWithOverflow(Limb, a.limbs[0], b.limbs[0], &o)) {
321 r.limbs[0] = o;
320322 r.len = 1;
321323 r.positive = a.positive;
322324 return;