+ ret in param fix in pass_typecheck for exp,frac,int,cos,sin,arctan,ln

git-svn-id: branches/z80@45015 -
This commit is contained in:
nickysn 2020-04-23 00:14:13 +00:00
parent 5200ff5e49
commit 661db99581

View File

@ -3528,11 +3528,18 @@ implementation
in_arctan_real,
in_ln_real :
begin
set_varstate(left,vs_read,[vsf_must_be_valid]);
{ on the Z80, the double result is returned in a var param, because
it's too big to fit in registers. In that case we have 2 parameters
and left.nodetype is a callparan. }
if left.nodetype = callparan then
temp_pnode := @tcallparanode(left).left
else
temp_pnode := @left;
set_varstate(temp_pnode^,vs_read,[vsf_must_be_valid]);
{ converting an int64 to double on platforms without }
{ extended can cause precision loss }
if not(left.nodetype in [ordconstn,realconstn]) then
inserttypeconv(left,pbestrealtype^);
if not(temp_pnode^.nodetype in [ordconstn,realconstn]) then
inserttypeconv(temp_pnode^,pbestrealtype^);
resultdef:=pbestrealtype^;
end;