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
1 changed files with 3 additions and 4 deletions

View File

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