Explorar o código

* 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 %!s(int64=9) %!d(string=hai) anos
pai
achega
cf925a108d
Modificáronse 1 ficheiros con 14 adicións e 0 borrados
  1. 14 0
      compiler/hlcgobj.pas

+ 14 - 0
compiler/hlcgobj.pas

@@ -5158,6 +5158,8 @@ implementation
     end;
 
   procedure thlcgobj.gen_load_loc_cgpara(list: TAsmList; vardef: tdef; const l: tlocation; const cgpara: tcgpara);
+    var
+      tmploc: tlocation;
     begin
       { Handle Floating point types differently
 
@@ -5173,6 +5175,18 @@ implementation
           exit;
         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
         LOC_CONSTANT,
         LOC_REGISTER,