Browse Source

* handle shortstrings like arrays and records when returning them from functions

git-svn-id: trunk@6563 -
florian 18 years ago
parent
commit
2566e38eae
1 changed files with 10 additions and 1 deletions
  1. 10 1
      compiler/x86_64/cpupara.pas

+ 10 - 1
compiler/x86_64/cpupara.pas

@@ -140,7 +140,16 @@ unit cpupara;
                loc1:=LOC_REFERENCE;
                loc1:=LOC_REFERENCE;
            stringdef:
            stringdef:
              if is_shortstring(p) or is_longstring(p) then
              if is_shortstring(p) or is_longstring(p) then
-               loc1:=LOC_REFERENCE
+               begin
+                 { handle long and shortstrings like arrays }
+                 { win64 abi }
+                 if ((target_info.system=system_x86_64_win64) and (p.size<=8)) or
+                   { linux abi }
+                   ((target_info.system<>system_x86_64_win64) and (p.size<=16)) then
+                   loc1:=LOC_REGISTER
+                 else
+                   loc1:=LOC_REFERENCE;
+               end
              else
              else
                loc1:=LOC_REGISTER;
                loc1:=LOC_REGISTER;
            setdef:
            setdef: