* fix reg. allocs even for procedures without labels

git-svn-id: trunk@21309 -
This commit is contained in:
florian 2012-05-15 18:09:12 +00:00
parent 17dd362a5a
commit 8832a34b67

View File

@ -119,10 +119,12 @@ Unit aopt;
Begin
CreateUsedRegs(Regs);
With LabelInfo^ Do
begin
If (LabelDif <> 0) Then
Begin
GetMem(LabelTable, LabelDif*SizeOf(TLabelTableItem));
FillChar(LabelTable^, LabelDif*SizeOf(TLabelTableItem), 0);
end;
p := BlockStart;
While (P <> BlockEnd) Do
Begin
@ -211,7 +213,7 @@ Unit aopt;
(p.typ in (SkipInstr - [ait_regalloc])) Do
P := tai(P.Next)
End;
End;
end;
ReleaseUsedRegs(Regs);
End;
@ -227,6 +229,7 @@ Unit aopt;
LabelInfo^.highlabel:=0;
end;
procedure tasmoptimizer.pass_1;
begin
findlohilabels;
@ -290,8 +293,11 @@ Unit aopt;
End;
End;
Destructor TAsmOptimizer.Destroy;
Begin
if assigned(LabelInfo^.LabelTable) then
Freemem(LabelInfo^.LabelTable);
Dispose(LabelInfo)
End;