* Procvars (methodpointers) must be treated as records, too. Fixes tw12318.pp and tw14155.pp after r23377.

* Factored related code into a separate method, as it will probably need further refinement.

git-svn-id: trunk@23387 -
This commit is contained in:
sergei 2013-01-15 10:39:14 +00:00
parent c7a9e17bc5
commit b5eecab582

View File

@ -87,6 +87,7 @@ interface
intparareg,
intparasize : longint;
can_use_float : boolean;
function is_abi_record(def: tdef): boolean;
procedure create_paraloc_info_intern(p : tabstractprocdef; side: tcallercallee; paras: tparalist);
end;
@ -113,6 +114,15 @@ implementation
end;
{ whether "def" must be treated as record when used as function result,
i.e. its address passed in a0 }
function TMIPSParaManager.is_abi_record(def: tdef): boolean;
begin
result:=(def.typ=recorddef) or
((def.typ=procvardef) and not tprocvardef(def).is_addressonly);
end;
procedure TMIPSParaManager.GetIntParaLoc(pd : tabstractprocdef; nr : longint; var cgpara : tcgpara);
var
paraloc : pcgparalocation;
@ -201,7 +211,7 @@ implementation
else
retdef:=p.returndef;
if ret_in_param(retdef,p.proccalloption) and
(retdef.typ=recorddef) then
is_abi_record(retdef) then
begin
if intparareg=0 then
inc(intparareg);
@ -374,7 +384,7 @@ implementation
paraloc^.size:=paracgsize;
{ ret in param? }
if (vo_is_funcret in hp.varoptions) and
(hp.vardef.typ=recorddef) then
is_abi_record(hp.vardef) then
begin
{ This should be the first parameter }
if (side=calleeside) and assigned(current_procinfo) then