+ in some language modes the loop counter is undefined after the loop by language definition

git-svn-id: trunk@44043 -
This commit is contained in:
florian 2020-01-26 20:13:18 +00:00
parent 3c18dee694
commit 56d64b007f

View File

@ -507,6 +507,13 @@ implementation
exclude(loopvarsym.varoptions,vo_is_loop_counter);
result:=cfornode.create(hloopvar,hfrom,hto,hblock,backward);
{ only in tp and mac pascal mode, we care about the value of the loop counter on loop exit
I am not sure though, if this is the right rule, at least in delphi the loop counter is undefined
on loop exit, we assume the same in all FPC modes }
if ([m_objfpc,m_fpc,m_delphi]*current_settings.modeswitches)<>[] then
Include(tfornode(Result).loopflags,lnf_dont_mind_loopvar_on_exit);
end;