You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make control flow analysis of infinite FOR consistent with infinite while loops
An upcoming change in MaybeReachingVariableUse unit tests exposed an issue with FOR loops where `for(i=0; ; i++) {x=1;} foo(x)` would still create an edge (Branch.ON_FALSE) in the CFG from the FOR node to the `foo(x)` node after the block ends.
This behavior is incorrect because, with the Branch.ON_FALSE down edge from FOR to `foo(x)` the MaybeReachingVariableUse pass will consider the foo(x) use reachable to the def `x=1`, when in reality it is not reachable.
Inconsistency:
`for(;;) { x=1;} foo(x);` // considered not reachable use
`for(;true;) { x=1;} foo(x);` // considered reachable use
This CL fixes the above inconsistency.
PiperOrigin-RevId: 322491736
0 commit comments