If we model a loop inside a fork inside a loop then it is possible that an old pass with a high iteration number (in the innermost circle) can be mistaken with a new pass with the same iteration number (now produced by the outer circle, but passing in the inner circle).
The proposed solution (after a discussion between Sérgio and Jorge) is to change the "iteration" counter to a stack-based iteration counter, increasing the stack at the entry of a loop and decreasing at the exit.
Happy coding. ;)