diff --git a/compiler/nflw.pas b/compiler/nflw.pas index 2d2d2da71b..afe348df69 100644 --- a/compiler/nflw.pas +++ b/compiler/nflw.pas @@ -1446,20 +1446,20 @@ implementation function tfornode.simplify(forinline : boolean) : tnode; begin result:=nil; - { Can we spare the first comparision? } - if (t1.nodetype=ordconstn) and - (right.nodetype=ordconstn) and + { Can we spare the first comparision? } + if (t1.nodetype=ordconstn) and + (right.nodetype=ordconstn) and + ( ( - ( - (lnf_backward in loopflags) and - (Tordconstnode(right).value>=Tordconstnode(t1).value) - ) or - ( - not(lnf_backward in loopflags) and - (Tordconstnode(right).value<=Tordconstnode(t1).value) - ) - ) then - exclude(loopflags,lnf_testatbegin); + (lnf_backward in loopflags) and + (Tordconstnode(right).value>=Tordconstnode(t1).value) + ) or + ( + not(lnf_backward in loopflags) and + (Tordconstnode(right).value<=Tordconstnode(t1).value) + ) + ) then + exclude(loopflags,lnf_testatbegin); if (t1.nodetype=ordconstn) and (right.nodetype=ordconstn) and @@ -1473,7 +1473,7 @@ implementation (tordconstnode(right).value>tordconstnode(t1).value) ) ) then - result:=cnothingnode.create; + result:=cnothingnode.create; end; @@ -1520,6 +1520,7 @@ implementation if assigned(t2) then typecheckpass(t2); + result:=simplify(false); end; @@ -2251,6 +2252,7 @@ implementation result:=cnothingnode.create; end; + procedure ttryexceptnode.adjust_estimated_stack_size; begin inc(current_procinfo.estimatedtempsize,rec_jmp_buf.size*2);