mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 19:08:15 +02:00
* stack size estimation again improved
git-svn-id: trunk@46739 -
This commit is contained in:
parent
d0c9b4f982
commit
d5ce344b67
@ -58,7 +58,8 @@ unit cpupi;
|
||||
globals,systems,
|
||||
verbose,
|
||||
tgobj,
|
||||
symconst,symtype,symsym,symcpu,paramgr,
|
||||
symconst,symtype,symsym,symcpu,symdef,
|
||||
paramgr,
|
||||
cgutils,
|
||||
cgobj,
|
||||
defutil,
|
||||
@ -127,7 +128,12 @@ unit cpupi;
|
||||
else
|
||||
begin
|
||||
localsize:=align(localsize,tparavarsym(procdef.parast.SymList[i]).paraloc[calleeside].alignment);
|
||||
inc(localsize,tabstractnormalvarsym(procdef.parast.SymList[i]).getsize);
|
||||
{ getsize returns 0 for e.g. open arrays, however, they require a pointer at the stack, so
|
||||
allocate one pointer }
|
||||
if tabstractnormalvarsym(procdef.parast.SymList[i]).getsize=0 then
|
||||
inc(localsize,voidpointertype.size)
|
||||
else
|
||||
inc(localsize,tabstractnormalvarsym(procdef.parast.SymList[i]).getsize);
|
||||
end;
|
||||
end;
|
||||
inc(stackframesize,localsize);
|
||||
@ -165,9 +171,9 @@ unit cpupi;
|
||||
if pi_estimatestacksize in flags then
|
||||
begin
|
||||
if pi_do_call in current_procinfo.flags then
|
||||
extra:=4*4+maxcall*4
|
||||
extra:=maxcall*4+4*4
|
||||
else
|
||||
extra:=0;
|
||||
extra:=4*4;
|
||||
if Align(tg.direction*tg.lasttemp,max(current_settings.alignment.localalignmin,4))+extra>stackframesize then
|
||||
InternalError(2020082801);
|
||||
result:=stackframesize
|
||||
|
Loading…
Reference in New Issue
Block a user