From 76d7a1d5e590f2a6cd8ee28f9fb0c044858bdabb Mon Sep 17 00:00:00 2001 From: "U-WIN-UA9ACS5GS9N\\vitor" Date: Thu, 7 Jun 2012 10:27:33 -0500 Subject: [PATCH] don't trust that X+200 is > X --- C/heapgc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C/heapgc.c b/C/heapgc.c index 0e63cfd58..c8eb03b48 100644 --- a/C/heapgc.c +++ b/C/heapgc.c @@ -3943,7 +3943,7 @@ do_gc(Int predarity, CELL *current_env, yamop *nextop USES_REGS) LOCAL_discard_trail_entries = 0; alloc_sz = (CELL *)LOCAL_TrailTop-(CELL*)LOCAL_GlobalBase; LOCAL_bp = Yap_PreAllocCodeSpace(); - while (LOCAL_bp+alloc_sz > (char *)AuxSp) { + while (IN_BETWEEN(LOCAL_bp, AuxSp, LOCAL_bp+alloc_sz)) { /* not enough space */ *--ASP = (CELL)current_env; LOCAL_bp = (char *)Yap_ExpandPreAllocCodeSpace(alloc_sz, NULL, TRUE);