mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 12:20:19 +02:00
* when the stack size is overestimated so much that it's larger than the
stack pointer (can happen for externally started threads), truncate it to a legal value (should stop crashes when enabling stack checking on iOS 6) git-svn-id: trunk@23320 -
This commit is contained in:
parent
51cce629e9
commit
5f3d762788
@ -314,7 +314,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
|
function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
|
||||||
|
var
|
||||||
|
stackpointer: ptruint;
|
||||||
begin
|
begin
|
||||||
|
stackpointer := (ptruint(sptr) + 4095) and not(4095);
|
||||||
|
if stklen > stackpointer then
|
||||||
|
stklen := stackpointer-4096;
|
||||||
result := stklen;
|
result := stklen;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user