mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 21:33:17 +02:00
Avoid arithmetic overflow inside heaptrc unit on this test
git-svn-id: trunk@41883 -
This commit is contained in:
parent
7b3e027dc8
commit
8ff0aaa369
@ -6,7 +6,13 @@ var
|
|||||||
p:pointer;
|
p:pointer;
|
||||||
begin
|
begin
|
||||||
returnnilifgrowheapfails:=true;
|
returnnilifgrowheapfails:=true;
|
||||||
GetMem(p,ptruint(-128));
|
{ Use a bigger absoulte value to avoid
|
||||||
|
getting a overflow inside heaptrc
|
||||||
|
if compiled with -gh option:
|
||||||
|
-128 changed to -1024,
|
||||||
|
which should be larger than typical
|
||||||
|
size of extra memory used by heaptrc }
|
||||||
|
GetMem(p,ptruint(-1024));
|
||||||
if assigned(p) then
|
if assigned(p) then
|
||||||
halt(1);
|
halt(1);
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user