Browse Source

* support subscripting record function results on ABI's that return
(some) records in registers (+ internalerror if unsupported
record location). Fixes "make all" in top dir on darwin/x86.

git-svn-id: trunk@2973 -

Jonas Maebe 19 years ago
parent
commit
2e41b63710
1 changed files with 16 additions and 1 deletions
  1. 16 1
      compiler/ncgmem.pas

+ 16 - 1
compiler/ncgmem.pas

@@ -302,7 +302,22 @@ implementation
               end;
               end;
            end
            end
          else
          else
-           location_copy(location,left.location);
+           begin
+             location_copy(location,left.location);
+             { some abi's require that functions return (some) records in }
+             { registers                                                  }
+             case location.loc of
+               LOC_REGISTER:
+                 location_force_mem(current_asmdata.CurrAsmList,location);
+               LOC_REFERENCE,
+               LOC_CREFERENCE:
+                 ;
+{              record regvars are not supported yet 
+               LOC_CREGISTER:                        }
+               else
+                 internalerror(2006031901);
+             end;
+           end;
 
 
          inc(location.reference.offset,vs.fieldoffset);
          inc(location.reference.offset,vs.fieldoffset);
          { also update the size of the location }
          { also update the size of the location }