Sfoglia il codice sorgente

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

git-svn-id: branches/z80@45015 -
nickysn 5 anni fa
parent
commit
661db99581
1 ha cambiato i file con 10 aggiunte e 3 eliminazioni
  1. 10 3
      compiler/ninl.pas

+ 10 - 3
compiler/ninl.pas

@@ -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;