return error message if no room available.

This commit is contained in:
Vitor Santos Costa 2009-05-17 09:42:40 -07:00
parent 55e37020a4
commit d8590f2587
1 changed files with 4 additions and 0 deletions

View File

@ -1600,6 +1600,10 @@ Yap_shift_visit(CELL **to_visit, CELL ***to_visit_maxp)
Int sz0 = AuxTop - (ADDR)to_visit_maxp, sz, dsz;
char *newb = Yap_ExpandPreAllocCodeSpace(0, NULL);
if (newb == NULL) {
Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"cannot allocate temporary space for unification (%p)", to_visit);
return to_visit;
}
/* check new size */
sz = AuxTop-newb;
/* how much we grew */