mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-11 04:01:37 +02:00
+ 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:
parent
3c18dee694
commit
56d64b007f
@ -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;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user