Browse Source

* fixed parameter allocation if there are fewer locations than the parameter
is long (e.g. if the last 4 bytes of a record is padding) -- not triggered
by default because we just extend the last parameter location to 8 bytes
in such a case, but can happen when we remove that for llvm

git-svn-id: trunk@32552 -

Jonas Maebe 9 years ago
parent
commit
9fd4531e79
1 changed files with 4 additions and 6 deletions
  1. 4 6
      compiler/x86_64/cpupara.pas

+ 4 - 6
compiler/x86_64/cpupara.pas

@@ -1172,10 +1172,10 @@ unit cpupara;
                   end;
 
                 locidx:=1;
-                while (paralen>0) do
+                while (paralen>0) and
+                      (locidx<=2) and
+                      (loc[locidx].typ<>X86_64_NO_CLASS) do
                   begin
-                    if locidx>2 then
-                      internalerror(200501283);
                     { Allocate }
                     case loc[locidx].typ of
                       X86_64_INTEGER_CLASS,
@@ -1296,9 +1296,7 @@ unit cpupara;
                       else
                         internalerror(2010053113);
                     end;
-                    if (locidx<2) and
-                       (loc[locidx+1].typ<>X86_64_NO_CLASS) then
-                      inc(locidx);
+                    inc(locidx);
                   end;
               end
             else