=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/engine/gmpq.c,v retrieving revision 1.5 retrieving revision 1.8 diff -u -p -r1.5 -r1.8 --- OpenXM_contrib2/asir2000/engine/gmpq.c 2017/01/08 03:05:39 1.5 +++ OpenXM_contrib2/asir2000/engine/gmpq.c 2017/08/31 02:36:21 1.8 @@ -7,6 +7,7 @@ mpz_t ONEMPZ; GZ ONEGZ; int lf_lazy; GZ current_mod_lf; +int current_mod_lf_size; void isqrtgz(GZ a,GZ *r); void bshiftgz(GZ a,int n,GZ *r); @@ -83,6 +84,7 @@ Q gztoz(GZ a) if ( !a ) return 0; len = WORDSIZE_IN_N(BDY((GZ)a)); nm = NALLOC(len); + fprintf(stderr,"%d ",len); mpz_export(BD(nm),&len,-1,sizeof(int),0,0,BDY((GZ)a)); PL(nm) = len; sgn = mpz_sgn(BDY((GZ)a)); NTOQ(nm,sgn,q); @@ -1323,7 +1325,10 @@ void lmtolf(LM a,GZ *b) { Q q; - NTOQ(BDY(a),1,q); *b = ztogz(q); + if ( !a ) *b = 0; + else { + NTOQ(BDY(a),1,q); *b = ztogz(q); + } } void setmod_lf(N p) @@ -1331,6 +1336,7 @@ void setmod_lf(N p) Q q; NTOQ(p,1,q); current_mod_lf = ztogz(q); + current_mod_lf_size = mpz_size(BDY(current_mod_lf))+1; } void simplf_force(GZ a,GZ *b)