From 402c4aa468dffa02eda123896a200408694ad0a1 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Mon, 3 Aug 2009 20:55:14 +0300 Subject: [PATCH] fixed bug in shift-left by multiples of 32/64 bits where the shifted data was misplaced in the resulting number. --- scheme/last-revision | 2 +- src/ikarus-numerics.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scheme/last-revision b/scheme/last-revision index 1105122..f625eb6 100644 --- a/scheme/last-revision +++ b/scheme/last-revision @@ -1 +1 @@ -1842 +1843 diff --git a/src/ikarus-numerics.c b/src/ikarus-numerics.c index 90520ad..0bba3b6 100644 --- a/src/ikarus-numerics.c +++ b/src/ikarus-numerics.c @@ -1623,8 +1623,9 @@ ikrt_bignum_shift_left(ikptr x, ikptr y, ikpcb* pcb){ pcb->root0 = 0; unsigned int* s = (unsigned int*)(long)(r+disp_bignum_data); bzero(s, whole_limb_shift*wordsize); - memcpy((char*)(long)s+whole_limb_shift, - (char*)(long)x+off_bignum_data, n*wordsize); + memcpy(((char*)s) + whole_limb_shift*wordsize, + ((char*)x) + off_bignum_data, + n*wordsize); return normalize_bignum(limb_count, bnfst_negative(fst), r); } else { int limb_count = n + whole_limb_shift + 1;