fix PL_is_list

This commit is contained in:
Vitor Santos Costa 2012-10-08 18:26:40 +01:00
parent daf9f589b9
commit b0ddda1fde

View File

@ -1799,7 +1799,7 @@ X_API int PL_is_list(term_t ts)
{ {
CACHE_REGS CACHE_REGS
YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); YAP_Term t = Yap_GetFromSlot(ts PASS_REGS);
return Yap_IsListTerm(t); return !IsVarTerm(t) && (t == TermNil || IsPairTerm(t));
} }
X_API int X_API int
@ -2316,7 +2316,7 @@ X_API int PL_next_solution(qid_t qi)
if (setjmp(LOCAL_execution->env)) if (setjmp(LOCAL_execution->env))
return 0; return 0;
if (qi->state == 0) { if (qi->state == 0) {
result = YAP_RunGoal(qi->g); result = YAP_RunGoal(qi->g);
} else { } else {
LOCAL_AllowRestart = qi->open; LOCAL_AllowRestart = qi->open;
result = YAP_RestartGoal(); result = YAP_RestartGoal();