fix overflow in SWI interface code.

This commit is contained in:
Vitor Santos Costa 2012-10-09 16:30:18 +01:00
parent ecf5ac655f
commit 3f6e56eb82
1 changed files with 5 additions and 0 deletions

View File

@ -843,6 +843,11 @@ X_API int PL_cons_functor_v(term_t d, functor_t f, term_t a0)
X_API int PL_cons_list(term_t d, term_t h, term_t t)
{
CACHE_REGS
if (Unsigned(H) > Unsigned(ASP)-CreepFlag) {
if (!do_gc(0)) {
return FALSE;
}
}
Yap_PutInSlot(d,MkPairTerm(Yap_GetFromSlot(h PASS_REGS),Yap_GetFromSlot(t PASS_REGS)) PASS_REGS);
return TRUE;
}