Răsfoiți Sursa

* fixed the offset of memory parameters allocated via getintparaloc():
the register parameters are not put on the stack, so don't count them
(only makes a practical difference for fixed stack targets, fixes
random crashes with webtbs/tw3870 on Darwin/i386)

git-svn-id: trunk@20499 -

Jonas Maebe 13 ani în urmă
părinte
comite
188677ea91
1 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  1. 3 2
      compiler/i386/cpupara.pas

+ 3 - 2
compiler/i386/cpupara.pas

@@ -284,7 +284,7 @@ unit cpupara;
            size:=OS_INT;
            if calloption=pocall_register then
              begin
-               if (nr<=high(parasupregs)+1) then
+               if (nr<=length(parasupregs)) then
                  begin
                    if nr=0 then
                      internalerror(200309271);
@@ -295,7 +295,8 @@ unit cpupara;
                  begin
                    loc:=LOC_REFERENCE;
                    reference.index:=NR_STACK_POINTER_REG;
-                   reference.offset:=sizeof(aint)*nr;
+                   { the previous parameters didn't take up room in memory }
+                   reference.offset:=sizeof(aint)*(nr-length(parasupregs)-1)
                  end;
              end
            else