From 398d46fc4e014c8677eb0a2544f5f63902a793f4 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 5 Feb 2011 10:27:51 +0000 Subject: [PATCH] fix occur_check patch. --- C/unify.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/C/unify.c b/C/unify.c index 4e4b7b81d..fa202e011 100644 --- a/C/unify.c +++ b/C/unify.c @@ -36,6 +36,7 @@ int Yap_rational_tree_loop(CELL *pt0, CELL *pt0_end, CELL **to_visit, CELL **to_visit_max) { + CELL ** base = to_visit; rtree_loop: while (pt0 < pt0_end) { register CELL *ptd0; @@ -91,7 +92,7 @@ rtree_loop: derefa_body(d0, ptd0, rtree_loop_unk, rtree_loop_nvar); } /* Do we still have compound terms to visit */ - if (to_visit < (CELL **)to_visit_base) { + if (to_visit < base) { pt0 = to_visit[0]; pt0_end = to_visit[1]; *pt0 = (CELL)to_visit[2]; @@ -102,7 +103,7 @@ rtree_loop: cufail: /* we found an infinite term */ - while (to_visit < (CELL **)to_visit_base) { + while (to_visit < (CELL **)base) { CELL *pt0; pt0 = to_visit[0]; *pt0 = (CELL)to_visit[2];