From 3f20b8d418642e46498416f48fac7d890f308645 Mon Sep 17 00:00:00 2001 From: vsc Date: Wed, 18 Jan 2006 06:02:02 +0000 Subject: [PATCH] fix GMP git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1522 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/adtdefs.c | 2 +- C/arith1.c | 1 - H/arith2.h | 6 +++++- changes-5.1.html | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/C/adtdefs.c b/C/adtdefs.c index 8495cc65b..e94502547 100644 --- a/C/adtdefs.c +++ b/C/adtdefs.c @@ -751,7 +751,7 @@ Yap_GetValue(Atom a) } #ifdef USE_GMP else { - out = Yap_MkBigIntTerm(Yap_BigIntOfTerm(out)); + out = Yap_MkBigIntTermCopy(Yap_BigIntOfTerm(out)); } #endif } diff --git a/C/arith1.c b/C/arith1.c index 42f45ee15..0f7d03ec7 100644 --- a/C/arith1.c +++ b/C/arith1.c @@ -101,7 +101,6 @@ EvalToTerm(blob_type f, union arith_ret *res) case big_int_e: { Term t = Yap_MkBigIntTerm(res->big); - mpz_clear(res->big); return t; } #endif diff --git a/H/arith2.h b/H/arith2.h index 0c9e1c0f5..4f305c2cd 100644 --- a/H/arith2.h +++ b/H/arith2.h @@ -688,7 +688,11 @@ p_times(Term t1, Term t2 E_ARGS) } case double_e: /* big * float */ - RFLOAT(mpz_get_d(v1.big)*v2.dbl); + { + Float dbl = mpz_get_d(v1.big)*v2.dbl; + mpz_clear(v1.big); + RFLOAT(dbl); + } case big_int_e: /* big * big */ { diff --git a/changes-5.1.html b/changes-5.1.html index a0ac5c848..2091e597f 100644 --- a/changes-5.1.html +++ b/changes-5.1.html @@ -16,7 +16,8 @@

Yap-5.1.0: