Description: Fix a FTBFS in sdiv_qrnnd() (only executed on s390) Forwarded: no Author: Peter Pentchev Last-Update: 2009-09-05 --- a/engine/support.c +++ b/engine/support.c @@ -724,16 +724,21 @@ DCell res; #if defined(sdiv_qrnnd) /* #warning "using sdiv_qrnnd" */ - Cell u1,q,r + Cell u1,q,r; UCell u0; UCell MAYBE_UNUSED lz; - vm_d2twoCell(u,u0,u1); - if (v==0) + vm_d2twoCell(num,u0,u1); + if (denom==0) throw(BALL_DIVZERO); - if (u1>=v) - throw(BALL_RESULTRANGE); - sdiv_qrnnd(q,r,u1,u0,v); + sdiv_qrnnd(q,r,u1,u0,denom); + if ((u1^denom)<0) { + if (q>0) + throw(BALL_RESULTRANGE); + } else { + if (q<0) + throw(BALL_RESULTRANGE); + } vm_twoCell2d(q,r,res); #else UDCell ures;