* 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 -
This commit is contained in:
nickysn 2014-09-14 14:47:13 +00:00
parent 3b205742b6
commit ad7111ad4d

View File

@ -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);