From 24d09ffde5c1e6ee42a6f5d07fb0003a87f53041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Mon, 23 Apr 2012 15:50:01 +0100 Subject: [PATCH] fix trailing issues in numbervars. --- C/utilpreds.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/C/utilpreds.c b/C/utilpreds.c index 1beb1381a..b71318f16 100644 --- a/C/utilpreds.c +++ b/C/utilpreds.c @@ -18,11 +18,9 @@ static char SccsId[] = "@(#)utilpreds.c 1.3"; #endif -#include "Yap.h" -#include "clause.h" +#include "absmi.h" #include "YapHeap.h" #include "yapio.h" -#include "eval.h" #include "attvar.h" #ifdef HAVE_STRING_H #include "string.h" @@ -4370,6 +4368,10 @@ static Int numbervars_in_complex_term(register CELL *pt0, register CELL *pt0_end goto trail_overflow; } } + +#if defined(TABLING) || defined(YAPOR_SBA) + TrailVal(TR) = (CELL)ptd0; +#endif TrailTerm(TR++) = (CELL)ptd0; } /* Do we still have compound terms to visit */ @@ -4387,6 +4389,7 @@ static Int numbervars_in_complex_term(register CELL *pt0, register CELL *pt0_end goto loop; } + prune(B); Yap_ReleasePreAllocCodeSpace((ADDR)to_visit0); return numbv;