Browse Source

* support multiple paralocs, force the source to memory in
thlcgobj.gen_load_loc_cgpara as only a_load_ref_cgpara supports
multiple locations

git-svn-id: trunk@32316 -

Jonas Maebe 9 years ago
parent
commit
cf925a108d
1 changed files with 14 additions and 0 deletions
  1. 14 0
      compiler/hlcgobj.pas

+ 14 - 0
compiler/hlcgobj.pas

@@ -5158,6 +5158,8 @@ implementation
     end;
     end;
 
 
   procedure thlcgobj.gen_load_loc_cgpara(list: TAsmList; vardef: tdef; const l: tlocation; const cgpara: tcgpara);
   procedure thlcgobj.gen_load_loc_cgpara(list: TAsmList; vardef: tdef; const l: tlocation; const cgpara: tcgpara);
+    var
+      tmploc: tlocation;
     begin
     begin
       { Handle Floating point types differently
       { Handle Floating point types differently
 
 
@@ -5173,6 +5175,18 @@ implementation
           exit;
           exit;
         end;
         end;
 
 
+      { in case of multiple locations, force the source to memory as only
+        a_load_ref_cgpara supports multiple locations }
+      if assigned(cgpara.location^.next) and
+         not(l.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
+        begin
+          tmploc:=l;
+          location_force_mem(list,tmploc,vardef);
+          a_load_loc_cgpara(list,vardef,tmploc,cgpara);
+          location_freetemp(list,tmploc);
+          exit;
+        end;
+
       case l.loc of
       case l.loc of
         LOC_CONSTANT,
         LOC_CONSTANT,
         LOC_REGISTER,
         LOC_REGISTER,