mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 14:19:28 +02:00
* 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:
parent
3b205742b6
commit
ad7111ad4d
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user