* fixed calling cdecl functions which return a large record with

use_fixed_stack on i386

git-svn-id: trunk@2872 -
This commit is contained in:
Jonas Maebe 2006-03-11 22:12:20 +00:00
parent 659d3e106d
commit 5f0f08dd18
2 changed files with 12 additions and 3 deletions

View File

@ -70,7 +70,17 @@ implementation
hreg : tregister;
begin
if (use_fixed_stack) then
exit;
begin
{ very weird: in this case the callee does a "ret $4" and the }
{ caller immediately a "subl $4,%esp". Possibly this is for }
{ use_fixed_stack code to be able to transparently call }
{ old-style code (JM) }
dec(pop_size,pushedparasize);
if (pop_size < 0) then
exprasmlist.concat(taicpu.op_const_reg(A_SUB,S_L,-pop_size,NR_ESP));
exit;
end;
{ better than an add on all processors }
if pop_size=4 then
begin

View File

@ -1845,8 +1845,7 @@ implementation
if current_procinfo.procdef.proccalloption in clearstack_pocalls then
begin
parasize:=0;
if not(use_fixed_stack) and
paramanager.ret_in_param(current_procinfo.procdef.rettype.def,current_procinfo.procdef.proccalloption) then
if paramanager.ret_in_param(current_procinfo.procdef.rettype.def,current_procinfo.procdef.proccalloption) then
inc(parasize,sizeof(aint));
end
else