fix occur_check patch.

This commit is contained in:
Vitor Santos Costa 2011-02-05 10:27:51 +00:00
parent c95134e94d
commit 398d46fc4e

View File

@ -36,6 +36,7 @@ int
Yap_rational_tree_loop(CELL *pt0, CELL *pt0_end, CELL **to_visit, CELL **to_visit_max) Yap_rational_tree_loop(CELL *pt0, CELL *pt0_end, CELL **to_visit, CELL **to_visit_max)
{ {
CELL ** base = to_visit;
rtree_loop: rtree_loop:
while (pt0 < pt0_end) { while (pt0 < pt0_end) {
register CELL *ptd0; register CELL *ptd0;
@ -91,7 +92,7 @@ rtree_loop:
derefa_body(d0, ptd0, rtree_loop_unk, rtree_loop_nvar); derefa_body(d0, ptd0, rtree_loop_unk, rtree_loop_nvar);
} }
/* Do we still have compound terms to visit */ /* Do we still have compound terms to visit */
if (to_visit < (CELL **)to_visit_base) { if (to_visit < base) {
pt0 = to_visit[0]; pt0 = to_visit[0];
pt0_end = to_visit[1]; pt0_end = to_visit[1];
*pt0 = (CELL)to_visit[2]; *pt0 = (CELL)to_visit[2];
@ -102,7 +103,7 @@ rtree_loop:
cufail: cufail:
/* we found an infinite term */ /* we found an infinite term */
while (to_visit < (CELL **)to_visit_base) { while (to_visit < (CELL **)base) {
CELL *pt0; CELL *pt0;
pt0 = to_visit[0]; pt0 = to_visit[0];
*pt0 = (CELL)to_visit[2]; *pt0 = (CELL)to_visit[2];