소스 검색

* SysTinyFreeMem: terminate with a runtime error if Addr is >= HeapPtr, since
InternalTinyFreeMem cannot handle that (which causes heap corruption), and it
indicates a bug in the program anyway, because the area between HeapPtr and
HeapEnd is free (so it indicates either a double free or freeing an invalid
pointer).

git-svn-id: trunk@28658 -

nickysn 11 년 전
부모
커밋
ad7111ad4d
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      rtl/inc/tinyheap.inc

+ 1 - 1
rtl/inc/tinyheap.inc

@@ -237,7 +237,7 @@
             exit;
           end;
         if (TTinyHeapPointerArithmeticType(addr) < TTinyHeapPointerArithmeticType(HeapOrg)) or
-           (TTinyHeapPointerArithmeticType(addr) >= TTinyHeapPointerArithmeticType(HeapEnd)) then
+           (TTinyHeapPointerArithmeticType(addr) >= TTinyHeapPointerArithmeticType(HeapPtr)) then
           HandleError(204);
         sz := Align(FindSize(addr)+SizeOf(TTinyHeapMemBlockSize), TinyHeapAllocGranularity);