mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 16:49:20 +02:00
* fixed repeat continue until true;
This commit is contained in:
parent
ba6a341854
commit
8772ddfc7b
@ -182,6 +182,7 @@ Fixed bugs:
|
|||||||
bug0157.pp Invalid compilation and also crashes OK 0.99.7 (PFV)
|
bug0157.pp Invalid compilation and also crashes OK 0.99.7 (PFV)
|
||||||
bug0158.pp Invalid boolean typecast OK 0.99.7 (PFV)
|
bug0158.pp Invalid boolean typecast OK 0.99.7 (PFV)
|
||||||
bug0159.pp Invalid virtual functions - should compile OK 0.99.7 (FK)
|
bug0159.pp Invalid virtual functions - should compile OK 0.99.7 (FK)
|
||||||
|
bug0162.pp continue in repeat ... until loop doesn't work correct OK 0.99.8 (PFV)
|
||||||
bug0164.pp crash when using undeclared array index in with statement OK 0.99.8 (PFV)
|
bug0164.pp crash when using undeclared array index in with statement OK 0.99.8 (PFV)
|
||||||
|
|
||||||
Unproducable bugs:
|
Unproducable bugs:
|
||||||
@ -216,7 +217,6 @@ bug0152.pp End value of loop variable must be calculated before loop
|
|||||||
variable is initialized.
|
variable is initialized.
|
||||||
bug0161.pp internal error when trying to create a set with another set as
|
bug0161.pp internal error when trying to create a set with another set as
|
||||||
its element (instead of a syntax error)
|
its element (instead of a syntax error)
|
||||||
bug0162.pp continue in repeat ... until loop doesn't work correct
|
|
||||||
bug0163.pp missing <= and >= operators for sets.
|
bug0163.pp missing <= and >= operators for sets.
|
||||||
bug0165.pp missing range check code for enumerated types.
|
bug0165.pp missing range check code for enumerated types.
|
||||||
bug0166.pp forward type used in declaration crashes instead of error
|
bug0166.pp forward type used in declaration crashes instead of error
|
||||||
|
@ -55,62 +55,51 @@ implementation
|
|||||||
|
|
||||||
procedure second_while_repeatn(var p : ptree);
|
procedure second_while_repeatn(var p : ptree);
|
||||||
var
|
var
|
||||||
l1,l2,l3,oldclabel,oldblabel : plabel;
|
lcont,lbreak,lloop,
|
||||||
|
oldclabel,oldblabel : plabel;
|
||||||
otlabel,oflabel : plabel;
|
otlabel,oflabel : plabel;
|
||||||
begin
|
begin
|
||||||
getlabel(l1);
|
getlabel(lloop);
|
||||||
getlabel(l2);
|
getlabel(lcont);
|
||||||
|
getlabel(lbreak);
|
||||||
{ arrange continue and breaklabels: }
|
{ arrange continue and breaklabels: }
|
||||||
oldclabel:=aktcontinuelabel;
|
oldclabel:=aktcontinuelabel;
|
||||||
oldblabel:=aktbreaklabel;
|
oldblabel:=aktbreaklabel;
|
||||||
if p^.treetype=repeatn then
|
|
||||||
begin
|
|
||||||
emitl(A_LABEL,l1);
|
|
||||||
aktcontinuelabel:=l1;
|
|
||||||
aktbreaklabel:=l2;
|
|
||||||
cleartempgen;
|
|
||||||
if assigned(p^.right) then
|
|
||||||
secondpass(p^.right);
|
|
||||||
|
|
||||||
otlabel:=truelabel;
|
{ handling code at the end as it is much more efficient, and makes
|
||||||
oflabel:=falselabel;
|
while equal to repeat loop, only the end true/false is swapped (PFV) }
|
||||||
truelabel:=l2;
|
if p^.treetype=whilen then
|
||||||
falselabel:=l1;
|
emitl(A_JMP,lcont);
|
||||||
cleartempgen;
|
|
||||||
secondpass(p^.left);
|
emitl(A_LABEL,lloop);
|
||||||
maketojumpbool(p^.left);
|
|
||||||
emitl(A_LABEL,l2);
|
aktcontinuelabel:=lcont;
|
||||||
truelabel:=otlabel;
|
aktbreaklabel:=lbreak;
|
||||||
falselabel:=oflabel;
|
cleartempgen;
|
||||||
end
|
if assigned(p^.right) then
|
||||||
|
secondpass(p^.right);
|
||||||
|
|
||||||
|
emitl(A_LABEL,lcont);
|
||||||
|
otlabel:=truelabel;
|
||||||
|
oflabel:=falselabel;
|
||||||
|
if p^.treetype=whilen then
|
||||||
|
begin
|
||||||
|
truelabel:=lloop;
|
||||||
|
falselabel:=lbreak;
|
||||||
|
end
|
||||||
|
{ repeatn }
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{ handling code at the end as it is much more efficient }
|
truelabel:=lbreak;
|
||||||
emitl(A_JMP,l2);
|
falselabel:=lloop;
|
||||||
|
end;
|
||||||
|
cleartempgen;
|
||||||
|
secondpass(p^.left);
|
||||||
|
maketojumpbool(p^.left);
|
||||||
|
emitl(A_LABEL,lbreak);
|
||||||
|
truelabel:=otlabel;
|
||||||
|
falselabel:=oflabel;
|
||||||
|
|
||||||
emitl(A_LABEL,l1);
|
|
||||||
cleartempgen;
|
|
||||||
|
|
||||||
getlabel(l3);
|
|
||||||
aktcontinuelabel:=l2;
|
|
||||||
aktbreaklabel:=l3;
|
|
||||||
|
|
||||||
if assigned(p^.right) then
|
|
||||||
secondpass(p^.right);
|
|
||||||
|
|
||||||
emitl(A_LABEL,l2);
|
|
||||||
otlabel:=truelabel;
|
|
||||||
oflabel:=falselabel;
|
|
||||||
truelabel:=l1;
|
|
||||||
falselabel:=l3;
|
|
||||||
cleartempgen;
|
|
||||||
secondpass(p^.left);
|
|
||||||
maketojumpbool(p^.left);
|
|
||||||
|
|
||||||
emitl(A_LABEL,l3);
|
|
||||||
truelabel:=otlabel;
|
|
||||||
falselabel:=oflabel;
|
|
||||||
end;
|
|
||||||
aktcontinuelabel:=oldclabel;
|
aktcontinuelabel:=oldclabel;
|
||||||
aktbreaklabel:=oldblabel;
|
aktbreaklabel:=oldblabel;
|
||||||
end;
|
end;
|
||||||
@ -735,7 +724,10 @@ do_jmp:
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.18 1998-09-26 15:03:04 florian
|
Revision 1.19 1998-09-28 12:13:53 peter
|
||||||
|
* fixed repeat continue until true;
|
||||||
|
|
||||||
|
Revision 1.18 1998/09/26 15:03:04 florian
|
||||||
* small problems with DOM and excpetions fixed (code generation
|
* small problems with DOM and excpetions fixed (code generation
|
||||||
of raise was wrong and self was sometimes destroyed :()
|
of raise was wrong and self was sometimes destroyed :()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user