nb_getval of unbound stuff can succeed, just ask CHR.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1964 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2007-10-18 09:13:50 +00:00
parent 929d7acb2d
commit 268ad4ab73

View File

@ -1212,8 +1212,9 @@ p_nb_getval(void)
READ_LOCK(ge->GRWLock); READ_LOCK(ge->GRWLock);
to = ge->global; to = ge->global;
if (IsVarTerm(to) && IsUnboundVar(VarOfTerm(to))) { if (IsVarTerm(to) && IsUnboundVar(VarOfTerm(to))) {
READ_UNLOCK(ge->GRWLock); Term t = MkVarTerm();
return FALSE; Bind(VarOfTerm(to), t);
to = t;
} }
READ_UNLOCK(ge->GRWLock); READ_UNLOCK(ge->GRWLock);
return Yap_unify(ARG2, to); return Yap_unify(ARG2, to);