Browse Source

Correct code after change in set_common_funcretloc_info which made the call to ret_in_param always return false

git-svn-id: trunk@22206 -
pierre 13 years ago
parent
commit
91bfa84952
1 changed files with 9 additions and 3 deletions
  1. 9 3
      compiler/mips/cpupara.pas

+ 9 - 3
compiler/mips/cpupara.pas

@@ -184,12 +184,17 @@ implementation
       var
       var
         paraloc : pcgparalocation;
         paraloc : pcgparalocation;
         retcgsize  : tcgsize;
         retcgsize  : tcgsize;
+        retdef : tdef;
       begin
       begin
         if set_common_funcretloc_info(p,forcetempdef,retcgsize,result) then
         if set_common_funcretloc_info(p,forcetempdef,retcgsize,result) then
           begin
           begin
             { Return is passed as var parameter,
             { Return is passed as var parameter,
               in this case we use the first register R4 for it }
               in this case we use the first register R4 for it }
-            if ret_in_param(result.def,p.proccalloption) then
+            if assigned(forcetempdef) then
+              retdef:=forcetempdef
+            else
+              retdef:=p.returndef;
+            if ret_in_param(retdef,p.proccalloption) then
               begin
               begin
                 if intparareg=0 then
                 if intparareg=0 then
                   inc(intparareg);
                   inc(intparareg);
@@ -213,9 +218,10 @@ implementation
                   end
                   end
                 else
                 else
                   begin
                   begin
-                    getIntParaLoc(p.proccalloption,1,result.def,result);
+                    getIntParaLoc(p.proccalloption,1,retdef,result);
                   end;
                   end;
-                result.def:=getpointerdef(result.def);
+                // This is now done in set_common_funcretloc_info already  
+                // result.def:=getpointerdef(result.def);
               end;
               end;
             exit;
             exit;
           end;
           end;