Browse Source

Check if the current register was the last in the cgpara, to avoid running over the last register allocated.

git-svn-id: trunk@42159 -
Jeppe Johansen 6 năm trước cách đây
mục cha
commit
5bdc635f50
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      compiler/avr/cgcpu.pas

+ 3 - 2
compiler/avr/cgcpu.pas

@@ -274,8 +274,9 @@ unit cgcpu;
                   begin
                     load_para_loc(r,hp);
 
-                    for i2:=1 to tcgsize2size[hp^.Size] do
-                      r:=GetNextReg(r);
+                    if i<tcgsize2size[cgpara.Size] then
+                      for i2:=1 to tcgsize2size[hp^.Size] do
+                        r:=GetNextReg(r);
 
                     hp:=hp^.Next;
                   end;