mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-07-31 19:46:03 +02:00
* pass the correct size to a_load_cgparaloc_ref in gen_load_cgpara_loc to avoid to overwrite adjacent data
git-svn-id: trunk@36952 -
This commit is contained in:
parent
43b017bde0
commit
a53d6bd6bd
@ -676,6 +676,7 @@ implementation
|
|||||||
href : treference;
|
href : treference;
|
||||||
sizeleft : aint;
|
sizeleft : aint;
|
||||||
tempref : treference;
|
tempref : treference;
|
||||||
|
loadsize : tcgint;
|
||||||
{$ifdef mips}
|
{$ifdef mips}
|
||||||
//tmpreg : tregister;
|
//tmpreg : tregister;
|
||||||
{$endif mips}
|
{$endif mips}
|
||||||
@ -717,9 +718,18 @@ implementation
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
cg.a_load_cgparaloc_ref(list,paraloc^,href,tcgsize2size[paraloc^.size],destloc.reference.alignment);
|
{ the min(...) call ensures that we do not store more than place is left as
|
||||||
inc(href.offset,TCGSize2Size[paraloc^.size]);
|
paraloc^.size could be bigger than destloc.size of a parameter occupies a full register
|
||||||
dec(sizeleft,TCGSize2Size[paraloc^.size]);
|
and as on big endian system the parameters might be left aligned, we have to work
|
||||||
|
with the full register size for paraloc^.size }
|
||||||
|
if tcgsize2size[destloc.size]<>0 then
|
||||||
|
loadsize:=min(min(tcgsize2size[paraloc^.size],tcgsize2size[destloc.size]),sizeleft)
|
||||||
|
else
|
||||||
|
loadsize:=min(tcgsize2size[paraloc^.size],sizeleft);
|
||||||
|
|
||||||
|
cg.a_load_cgparaloc_ref(list,paraloc^,href,loadsize,destloc.reference.alignment);
|
||||||
|
inc(href.offset,loadsize);
|
||||||
|
dec(sizeleft,loadsize);
|
||||||
end;
|
end;
|
||||||
unget_para(paraloc^);
|
unget_para(paraloc^);
|
||||||
paraloc:=paraloc^.next;
|
paraloc:=paraloc^.next;
|
||||||
|
Loading…
Reference in New Issue
Block a user