fix occur-check unification (obs from Jason Filippou).

This commit is contained in:
Vítor Santos Costa 2011-02-02 20:45:42 +00:00
parent 8ab12ec680
commit 3efb549e02

View File

@ -56,7 +56,7 @@ rtree_loop:
} }
to_visit[0] = pt0; to_visit[0] = pt0;
to_visit[1] = pt0_end; to_visit[1] = pt0_end;
to_visit[2] = (CELL *)d0; to_visit[2] = (CELL *)*pt0;
*pt0 = TermFoundVar; *pt0 = TermFoundVar;
pt0_end = (pt0 = RepPair(d0) - 1) + 2; pt0_end = (pt0 = RepPair(d0) - 1) + 2;
continue; continue;
@ -78,7 +78,7 @@ rtree_loop:
} }
to_visit[0] = pt0; to_visit[0] = pt0;
to_visit[1] = pt0_end; to_visit[1] = pt0_end;
to_visit[2] = (CELL *)d0; to_visit[2] = (CELL *)*pt0;
*pt0 = TermFoundVar; *pt0 = TermFoundVar;
d0 = ArityOfFunctor(f); d0 = ArityOfFunctor(f);
pt0 = ap2; pt0 = ap2;
@ -102,14 +102,13 @@ rtree_loop:
cufail: cufail:
/* we found an infinite term */ /* we found an infinite term */
while (to_visit < to_visit_max) { while (to_visit < (CELL **)to_visit_base) {
CELL *pt0; CELL *pt0;
pt0 = to_visit[0]; pt0 = to_visit[0];
*pt0 = (CELL)to_visit[2]; *pt0 = (CELL)to_visit[2];
to_visit += 3; to_visit += 3;
} }
return TRUE; return TRUE;
} }
static inline int static inline int