From 61ad7c6da8c3419bfd3a176197ca8a50b505ebb8 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sun, 26 Apr 2009 19:24:21 -0500 Subject: [PATCH] fix non-gmp calls to arith2 --- H/arith2.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/H/arith2.h b/H/arith2.h index 658b1767d..fe2ccb849 100644 --- a/H/arith2.h +++ b/H/arith2.h @@ -139,7 +139,14 @@ inline static Term do_sll(Int i, Int j) { if (sl_overflow(i,j)) { +#ifdef USE_GMP return Yap_gmp_sll_ints(i, j); +#else + Yap_Error(EVALUATION_ERROR_INT_OVERFLOW, t1, + "rem/2 with %d and %d", i1, i2); + P = (yamop *)FAILCODE; + RERROR(); +#endif } RINT(i << j); } @@ -343,7 +350,14 @@ p_div(Term t1, Term t2) { P = (yamop *)FAILCODE; RERROR(); } else if (i1 == Int_MIN && i2 == -1) { +#ifdef USE_GMP return Yap_gmp_add_ints(Int_MAX, 1); +#else + Yap_Error(EVALUATION_ERROR_INT_OVERFLOW, t1, + "rem/2 with %d and %d", i1, i2); + P = (yamop *)FAILCODE; + RERROR(); +#endif } else { RINT(IntegerOfTerm(t1) / i2); }