fix very large clause handling

This commit is contained in:
Vitor Santos Costa 2010-10-08 10:45:50 +01:00
parent da0aee0f57
commit 9187c658b8

View File

@ -1677,7 +1677,8 @@ Yap_absmi(int inp)
/* ensure_space */ /* ensure_space */
BOp(ensure_space, Osbpi); BOp(ensure_space, Osbpi);
{ {
Int sz = PREG->u.Osbpi.i; Int sz = PREG->u.Osbpi.i;
UInt arity = PREG->u.Osbpi.p->ArityOfPE;
PREG = NEXTOP(PREG,Osbpi); PREG = NEXTOP(PREG,Osbpi);
if (Unsigned(H) + sz > Unsigned(YREG)-CreepFlag) { if (Unsigned(H) + sz > Unsigned(YREG)-CreepFlag) {
YENV[E_CP] = (CELL) CPREG; YENV[E_CP] = (CELL) CPREG;
@ -1689,7 +1690,7 @@ Yap_absmi(int inp)
if (ASP > (CELL *)PROTECT_FROZEN_B(B)) if (ASP > (CELL *)PROTECT_FROZEN_B(B))
ASP = (CELL *)PROTECT_FROZEN_B(B); ASP = (CELL *)PROTECT_FROZEN_B(B);
saveregs(); saveregs();
if (!Yap_gcl(sz, PREG->u.Osbpi.p->ArityOfPE, YENV, PREG)) { if (!Yap_gcl(sz, arity, YENV, PREG)) {
Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage);
setregs(); setregs();
FAIL(); FAIL();