summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-09-27 13:06:39 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-09-27 13:06:39 +0000
commit4d8ae284b4494e1ace369056e66527a37c8c847d (patch)
tree598f4b50f9ace03d4e615b2614acebf2e0053011
parentfe9cfe171148047c14c7b07a1e3965f788d01e31 (diff)
downloadmpfr-4d8ae284b4494e1ace369056e66527a37c8c847d.tar.gz
fixed Array Bound Write
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@755 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--sub.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sub.c b/sub.c
index 14b16c55b..469555dfc 100644
--- a/sub.c
+++ b/sub.c
@@ -247,7 +247,7 @@ mpfr_sub1(a, b, c, rnd_mode, diff_exp)
if (k>an) ap[an-1] += cp[cn-k+an]<<(BITS_PER_MP_LIMB-dif);
}
else if (dif<0) {
- cc = mpn_lshift(ap, cp+(cn-k), k, -dif);
+ cc = mpn_lshift(ap, cp+(cn-k), (k<=an) ? k : an, -dif);
if (k<an) ap[k]=cc;
/* put the non-significant bits in low limb for further rounding */
if (cn >= k+1)