check overflow correctly.

This commit is contained in:
Vitor Santos Costa 2010-03-30 12:45:46 +01:00
parent c4819d8ab2
commit 3f5117d020
1 changed files with 1 additions and 1 deletions

View File

@ -233,7 +233,7 @@ Yap_GetFromArena(Term *arenap, UInt cells, UInt arity)
H += cells;
return base;
}
if (base+cells > ASP-1024) {
if (base+cells > max-1024) {
if (!GrowArena(arena, max, old_sz, old_sz+sizeof(CELL)*1024, arity))
return NULL;
goto restart;