|
@@ -951,15 +951,25 @@ begin
|
|
|
{ Avoid recursive calls when called from the exit routines }
|
|
|
if StackError then
|
|
|
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
|
|
|
}
|
|
|
c := Sptr - STACK_MARGIN;
|
|
|
if (c <= StackBottom) then
|
|
|
- begin
|
|
|
- StackError:=true;
|
|
|
- HandleError(202);
|
|
|
- end;
|
|
|
+ begin
|
|
|
+ StackError:=true;
|
|
|
+ HandleError(202);
|
|
|
+ end;
|
|
|
end;
|
|
|
{$POP}
|
|
|
|