* fixed allocation of function result location

git-svn-id: trunk@45858 -
This commit is contained in:
Jonas Maebe 2020-07-25 20:26:24 +00:00
parent e6b89c98f5
commit a534fb9acd

View File

@ -280,6 +280,7 @@ unit cpupara;
function tcpuparamanager.get_funcretloc(p : tabstractprocdef; side: tcallercallee; forcetempdef: tdef): tcgpara;
var
retcgsize: tcgsize;
otherside: tcallercallee;
begin
if set_common_funcretloc_info(p,forcetempdef,retcgsize,result) then
exit;
@ -287,7 +288,13 @@ unit cpupara;
{ in this case, it must be returned in registers as if it were passed
as the first parameter }
init_para_alloc_values;
alloc_para(result,p,vs_value,side,result.def,false,false);
{ if we're on the callee side, filling the result location is actually the "callerside"
as far passing it as a parameter value is concerned }
if side=callerside then
otherside:=calleeside
else
otherside:=callerside;
alloc_para(result,p,vs_value,otherside,result.def,false,false);
{ sanity check (LOC_VOID for empty records) }
if not assigned(result.location) or
not(result.location^.loc in [LOC_REGISTER,LOC_MMREGISTER,LOC_VOID]) then