mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 21:20:24 +02:00
* fixed allocation of function result location
git-svn-id: trunk@45858 -
This commit is contained in:
parent
e6b89c98f5
commit
a534fb9acd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user