fix is_list to fail on infinite lists.

This commit is contained in:
Vítor Santos Costa 2012-03-04 10:45:32 +00:00
parent 5a472616e7
commit fbe846e74a

View File

@ -4223,10 +4223,9 @@ camacho_dum( USES_REGS1 )
int int
Yap_IsListTerm(Term t) Yap_IsListTerm(Term t)
{ {
while (!IsVarTerm(t) && IsPairTerm(t)) { Term *tailp;
t = TailOfTerm(t); Yap_SkipList(&t, &tailp);
} return *tailp == TermNil;
return t == TermNil;
} }
static Int static Int