From 344ff48512561b57022c1f686005b3283da07cc5 Mon Sep 17 00:00:00 2001 From: aiju Date: Sun, 28 Aug 2016 11:38:29 +0200 Subject: [PATCH] mp: fix mptov and mptouv --- sys/src/libmp/port/mptouv.c | 4 ++-- sys/src/libmp/port/mptov.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/src/libmp/port/mptouv.c b/sys/src/libmp/port/mptouv.c index 9e52a357f..760b38fb5 100644 --- a/sys/src/libmp/port/mptouv.c +++ b/sys/src/libmp/port/mptouv.c @@ -14,10 +14,10 @@ uvtomp(uvlong v, mpint *b) int s; if(b == nil){ - b = mpnew(VLDIGITS*sizeof(mpdigit)); + b = mpnew(VLDIGITS*Dbits); setmalloctag(b, getcallerpc(&v)); }else - mpbits(b, VLDIGITS*sizeof(mpdigit)); + mpbits(b, VLDIGITS*Dbits); b->sign = 1; for(s = 0; s < VLDIGITS; s++){ b->p[s] = v; diff --git a/sys/src/libmp/port/mptov.c b/sys/src/libmp/port/mptov.c index b1b3e93f7..2c76dc6c0 100644 --- a/sys/src/libmp/port/mptov.c +++ b/sys/src/libmp/port/mptov.c @@ -15,10 +15,10 @@ vtomp(vlong v, mpint *b) uvlong uv; if(b == nil){ - b = mpnew(VLDIGITS*sizeof(mpdigit)); + b = mpnew(VLDIGITS*Dbits); setmalloctag(b, getcallerpc(&v)); }else - mpbits(b, VLDIGITS*sizeof(mpdigit)); + mpbits(b, VLDIGITS*Dbits); b->sign = (v >> (sizeof(v)*8 - 1)) | 1; uv = v * b->sign; for(s = 0; s < VLDIGITS; s++){ -- 2.44.0