generate an Error on memory overflow.

This commit is contained in:
Vitor Santos Costa 2008-10-29 18:19:15 +00:00
parent 67d9e0ef26
commit de043e3ee9

View File

@ -669,9 +669,11 @@ YAP_MkBlobTerm(unsigned int sz)
BACKUP_H();
while (H+(sz+sizeof(MP_INT)/sizeof(CELL)+2) > ASP-1024) {
if (!doexpand((sz+sizeof(MP_INT)/sizeof(CELL)+2)*sizeof(CELL)))
if (!doexpand((sz+sizeof(MP_INT)/sizeof(CELL)+2)*sizeof(CELL))) {
Yap_Error(OUT_OF_STACK_ERROR, TermNil, "YAP failed to grow the stack while constructing a blob: %s", Yap_ErrorMessage);
return TermNil;
}
}
I = AbsAppl(H);
H[0] = (CELL)FunctorBigInt;
dst = (MP_INT *)(H+1);