mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 20:09:27 +02:00
* don't remove repeat until node in repeat until true;
This commit is contained in:
parent
f8849f9396
commit
bd34e0dd69
@ -379,26 +379,13 @@ implementation
|
|||||||
CGMessage1(type_e_boolean_expr_expected,left.resulttype.def.typename);
|
CGMessage1(type_e_boolean_expr_expected,left.resulttype.def.typename);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ optimize constant expressions }
|
{ Give warnings for code that will never be executed for
|
||||||
if (left.nodetype=ordconstn) then
|
while false do }
|
||||||
begin
|
if (lnf_testatbegin in loopflags) and
|
||||||
{ while false do }
|
(left.nodetype=ordconstn) and
|
||||||
if (lnf_testatbegin in loopflags) and
|
(tordconstnode(left).value=0) and
|
||||||
(tordconstnode(left).value=0) then
|
assigned(right) then
|
||||||
begin
|
CGMessagePos(right.fileinfo,cg_w_unreachable_code);
|
||||||
if assigned(right) then
|
|
||||||
CGMessagePos(right.fileinfo,cg_w_unreachable_code);
|
|
||||||
result:=cnothingnode.create;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
{ repeat until true }
|
|
||||||
if not(lnf_testatbegin in loopflags) and
|
|
||||||
(tordconstnode(left).value=1) then
|
|
||||||
begin
|
|
||||||
result:=right;
|
|
||||||
right:=nil;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1404,7 +1391,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.110 2005-02-23 20:38:09 florian
|
Revision 1.111 2005-03-24 23:06:43 peter
|
||||||
|
* don't remove repeat until node in repeat until true;
|
||||||
|
|
||||||
|
Revision 1.110 2005/02/23 20:38:09 florian
|
||||||
+ variants can be used as cond. expr. in if, while, repeat ... until statements
|
+ variants can be used as cond. expr. in if, while, repeat ... until statements
|
||||||
|
|
||||||
Revision 1.109 2005/02/14 17:13:06 peter
|
Revision 1.109 2005/02/14 17:13:06 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user