max > nelem(stk) is wrong. should be >=; change to assert. Reference: /n/sources/patch/applied/mpfact-ineq Date: Thu Jan 5 20:49:05 CET 2012 Signed-off-by: quanstro@quanstro.net --- /sys/src/libmp/port/mpfactorial.c Thu Jan 5 20:48:35 2012 +++ /sys/src/libmp/port/mpfactorial.c Thu Jan 5 20:48:33 2012 @@ -42,8 +42,7 @@ max++; if(max > mmax){ mmax++; - if(max > nelem(stk)) - abort(); + assert(max < nelem(stk)); stk[max] = mpnew(Dbits); } stk[max]->top = 1;