mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-07 09:59:39 +01:00
* stack checking checks also proper alignment
git-svn-id: trunk@43011 -
This commit is contained in:
parent
bd35c02257
commit
1872bee116
@ -951,15 +951,25 @@ begin
|
|||||||
{ Avoid recursive calls when called from the exit routines }
|
{ Avoid recursive calls when called from the exit routines }
|
||||||
if StackError then
|
if StackError then
|
||||||
exit;
|
exit;
|
||||||
{ don't use sack_size, since the stack pointer has already been
|
{ check stack alignment }
|
||||||
|
{$ifdef CPUI386}
|
||||||
|
{$ifdef FPC_STACKALIGNMENT=16}
|
||||||
|
if ((PtrUInt(Sptr)+4) mod 16)<>0 then
|
||||||
|
begin
|
||||||
|
StackError:=true;
|
||||||
|
HandleError(202);
|
||||||
|
end;
|
||||||
|
{$endif FPC_STACKALIGNMENT=16}
|
||||||
|
{$endif CPUI386}
|
||||||
|
{ don't use stack_size, since the stack pointer has already been
|
||||||
decreased when this routine is called
|
decreased when this routine is called
|
||||||
}
|
}
|
||||||
c := Sptr - STACK_MARGIN;
|
c := Sptr - STACK_MARGIN;
|
||||||
if (c <= StackBottom) then
|
if (c <= StackBottom) then
|
||||||
begin
|
begin
|
||||||
StackError:=true;
|
StackError:=true;
|
||||||
HandleError(202);
|
HandleError(202);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$POP}
|
{$POP}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user