mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 09:09:09 +02:00
Avoid wrap on 32-bit system for StackTop calculation
git-svn-id: trunk@39735 -
This commit is contained in:
parent
70fae803ce
commit
16e2bdad5a
@ -717,7 +717,11 @@ End;
|
|||||||
{$ifndef FPC_SYSTEM_HAS_STACKTOP}
|
{$ifndef FPC_SYSTEM_HAS_STACKTOP}
|
||||||
function StackTop: pointer;
|
function StackTop: pointer;
|
||||||
begin
|
begin
|
||||||
result:=StackBottom+StackLength;
|
{ Avoid wrap to zero on 32-bit }
|
||||||
|
if ptruint(StackBottom)+ StackLength > high(ptruint) then
|
||||||
|
result:=pointer(ptruint(high(ptruint)))
|
||||||
|
else
|
||||||
|
result:=StackBottom + StackLength;
|
||||||
end;
|
end;
|
||||||
{$endif FPC_SYSTEM_HAS_STACKTOP}
|
{$endif FPC_SYSTEM_HAS_STACKTOP}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user