From eaa598094ecfe3f275082f94684055807087ad9a Mon Sep 17 00:00:00 2001 From: micha Date: Mon, 28 May 2007 15:06:19 +0000 Subject: [PATCH] * heap manager: do not access chunk after last one git-svn-id: trunk@7497 - --- rtl/inc/heap.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rtl/inc/heap.inc b/rtl/inc/heap.inc index 05a4bd4c2f..c45179b4fe 100644 --- a/rtl/inc/heap.inc +++ b/rtl/inc/heap.inc @@ -1215,8 +1215,9 @@ begin We first check if the blocks after the current block are free. If not then we simply call getmem/freemem to get the new block } pnext:=pmemchunk_var(pointer(pcurr)+currsize); - if ((pnext^.size and usedflag) = 0) - and ((pnext^.size and sizemask) > size-currsize) then + if ((chunksize and lastblockflag) = 0) + and ((pnext^.size and usedflag) = 0) + and ((pnext^.size and sizemask) >= size-currsize) then begin concat_two_blocks(pcurr,pnext); currsize := pcurr^.size and sizemask;