Browse Source

* fixed range errors in label bookkeeping that caused too much memory to be
allocated for optimising jumps

git-svn-id: trunk@14470 -

Jonas Maebe 15 years ago
parent
commit
666b4e2469
2 changed files with 6 additions and 6 deletions
  1. 4 4
      compiler/aopt.pas
  2. 2 2
      compiler/aoptobj.pas

+ 4 - 4
compiler/aopt.pas

@@ -74,7 +74,7 @@ Unit aopt;
       Var LabelFound: Boolean;
       Var LabelFound: Boolean;
           p: tai;
           p: tai;
       Begin
       Begin
-        LabelInfo^.LowLabel := High(AWord);
+        LabelInfo^.LowLabel := High(longint);
         LabelInfo^.HighLabel := 0;
         LabelInfo^.HighLabel := 0;
         LabelInfo^.LabelDif := 0;
         LabelInfo^.LabelDif := 0;
         LabelInfo^.LabelTable:=nil;
         LabelInfo^.LabelTable:=nil;
@@ -91,9 +91,9 @@ Unit aopt;
                    (tai_Label(p).labsym.is_used) Then
                    (tai_Label(p).labsym.is_used) Then
                   Begin
                   Begin
                     LabelFound := True;
                     LabelFound := True;
-                    If (tai_Label(p).labsym.labelnr < int64(LowLabel)) Then
+                    If (tai_Label(p).labsym.labelnr < LowLabel) Then
                       LowLabel := tai_Label(p).labsym.labelnr;
                       LowLabel := tai_Label(p).labsym.labelnr;
-                    If (tai_Label(p).labsym.labelnr > int64(HighLabel)) Then
+                    If (tai_Label(p).labsym.labelnr > HighLabel) Then
                       HighLabel := tai_Label(p).labsym.labelnr
                       HighLabel := tai_Label(p).labsym.labelnr
                   End;
                   End;
                 GetNextInstruction(p, p)
                 GetNextInstruction(p, p)
@@ -191,7 +191,7 @@ Unit aopt;
             LabelInfo^.labeltable := nil;
             LabelInfo^.labeltable := nil;
           end;
           end;
         LabelInfo^.labeldif:=0;
         LabelInfo^.labeldif:=0;
-        LabelInfo^.lowlabel:=high(AWord);
+        LabelInfo^.lowlabel:=high(longint);
         LabelInfo^.highlabel:=0;
         LabelInfo^.highlabel:=0;
       end;
       end;
 
 

+ 2 - 2
compiler/aoptobj.pas

@@ -216,8 +216,8 @@ Unit AoptObj;
       TLabelInfo = Record
       TLabelInfo = Record
         { the highest and lowest label number occurring in the current code }
         { the highest and lowest label number occurring in the current code }
         { fragment                                                          }
         { fragment                                                          }
-        LowLabel, HighLabel: AWord;
-        LabelDif: AWord;
+        LowLabel, HighLabel: longint;
+        LabelDif: cardinal;
         { table that contains the addresses of the Pai_Label objects associated
         { table that contains the addresses of the Pai_Label objects associated
           with each label number                                                }
           with each label number                                                }
         LabelTable: PLabelTable;
         LabelTable: PLabelTable;