fix bad size in grow stack

This commit is contained in:
Vitor Santos Costa 2008-11-13 09:02:33 +00:00
parent 297ea16dcb
commit 6920041189

View File

@ -721,6 +721,7 @@ static_growglobal(long size, CELL **ptr, CELL *hsplit)
int do_grow = TRUE; int do_grow = TRUE;
CurrentDelayTop = (CELL *)omax; CurrentDelayTop = (CELL *)omax;
size0 = size;
if (hsplit) { if (hsplit) {
/* just a little bit of sanity checking */ /* just a little bit of sanity checking */
if (hsplit < (CELL*)omax || if (hsplit < (CELL*)omax ||
@ -734,9 +735,6 @@ static_growglobal(long size, CELL **ptr, CELL *hsplit)
do_grow = FALSE; do_grow = FALSE;
} }
} }
size0 = size;
if (size < ((char *)H0-omax)/8)
size = ((char *)H0-omax)/8;
if (do_grow) { if (do_grow) {
if (size < YAP_ALLOC_SIZE) if (size < YAP_ALLOC_SIZE)
size = YAP_ALLOC_SIZE; size = YAP_ALLOC_SIZE;